You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

[ |../../index.htm#lansa/webserviceseng01_0025.htm]
You are here:

Using XPRIM_HttpRequest

To use a web service, you need to make an HTTP request using an XPRIM_HttpRequest object.
Below is an example of how to do a simple GET request, and get the response as a string:
Define_Com Class(#XPRIM_HttpRequest) Name(#Request)
Define_Com Class(#PRIM_DC.UnicodeString) Name(#ResponseText)

  • Do the get request
    #Request.DoGet Url('http://mytestserver/api/echoservice')
  • Get the result as string
    #ResponseText := #Request.Response.AsString
    The XPRIM_HttpRequest has the following methods (each corresponds to an HTTP verb):
  • DoGet
  • DoPost
  • DoPut
  • DoDelete
  • DoPatch
  • DoTrace
  • DoHead
  • DoOptions

Next: Setting Up Your HTTP Request
[ |../../index.htm#lansa/webserviceseng01_0025.htm]

  • No labels