Given a REST API that has a url ending with ?login
and which wants a payload something like this:
How would I call the URL and deliver the payload in order to get a response?
I have tried a number of different GET requests on an HTTPSecureSocket, but I think I probably need a POST
I just cant work out where to put the parameters above
the only one who can tell you if you need the GET or the POST method, is the API developer itself.
Usually it is the GET method when you just want to get a simple json object. If you first have to upload/send another json object, for example with some options in it, then the POST method could be the way you have to use.
But both are really simple to use:
Dim socekt As New HTTPSecureSocket
Dim data As String
data = socekt.Get("https://www.example.com", 30)
Dim form As Dictionary
Dim socket1 As HTTPSecureSocket
socket1 = New HTTPSecureSocket
socket1.Secure = True
// create and populate the form object
form = New Dictionary
form.Value("firstname") = "Bob"
form.Value("lastname") = "Brown"
// setup the socket to POST the form
Use then the
PageReceifed Event to get the response of the Webserver after a POST call (http://documentation.xojo.com/api/deprecated/httpsecuresocket.html#httpsecuresocket-pagereceived)