Question Denys Kondratiuk · Dec 7, 2023

I want to call the REST endpoint and return the list of objects. I`ve created the method but it displays an error: 
<METHOD DOES NOT EXIST>GetAllPersons+10^Lab3.RestClient.1 *Count,%ZEN.proxyObject

ClassMethod GetAllPersons() As%Status
{
    Set request = ##class(%Net.HttpRequest).%New()
    Set sc = request.Get("http://localhost:52773/csp/crud/persons") 
    Quit:$System.Status.IsError(sc) sc

    Set responseStream = ##class(%Stream.GlobalBinary).%New()
    Set response = request.HttpResponse.Data.Read()
    
    Write"Response from Server:", !, response, !

    Set pl = ##class(%
2
0 634
Question Denys Kondratiuk · Dec 5, 2023

I need to create a simple REST application.
I`ve created an app:

Also here is a dispatcher class:
 

Class Lab3.helloWorld Extends%CSP.REST
{

Parameter Authentication = 0;Parameter HandleCorsRequest = 0;
XData UrlMap [ XMLNamespace = "https://www.intersystems.com/urlmap" ]
{
<Routes>
    <Route Url="/hello" Method="GET" Call="Hello" />
</Routes>
}

ClassMethod Hello() As%Status
{
	Do##class(%REST.Impl).%SetContentType("application/json")
    If '##class(%REST.Impl).%CheckAccepts("application/json") Do##class(%REST.Impl).%ReportRESTError(..#HTTP406NOTACCEPTABLE,$$$ERROR($$$RESTB
2
0 617