You are here: Web Services > Consuming Web Services > Using XPRIM_HttpRequest

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):

Next: Setting Up Your HTTP Request