Hi everyone,
I apologise for being probably the 100th person for asking a dumb, or repetitve question; but does anyone know if this is the right way to post JSON to a restful web service?
Dim req As HttpRequest
Dim hc As HttpClient
hc.Initialize("hc")
Dim Data As List
Data.Initialize
Data.Add("2,Sausages and chips,Make it nice,10")
Data.Add("5,Coke,,10")
Dim JSONGenerator1 As JSONGenerator
JSONGenerator1.Initialize2(Data)
req.InitializePost2("http://10.0.2.2:50579/Service1.svc", JSONGenerator1.ToPrettyString(2).GetBytes("UTF8"))
Sub hc_ResponseSuccess (Response As HttpResponse, TaskId As Int)
..
End Sub
Sub hc_ResponseError (Response As HttpResponse, Reason As String, StatusCode As Int, TaskId As Int)
..
End Sub
As usual, I really appreciate all of your assistance!
Regards,
Laurence
I apologise for being probably the 100th person for asking a dumb, or repetitve question; but does anyone know if this is the right way to post JSON to a restful web service?
Dim req As HttpRequest
Dim hc As HttpClient
hc.Initialize("hc")
Dim Data As List
Data.Initialize
Data.Add("2,Sausages and chips,Make it nice,10")
Data.Add("5,Coke,,10")
Dim JSONGenerator1 As JSONGenerator
JSONGenerator1.Initialize2(Data)
req.InitializePost2("http://10.0.2.2:50579/Service1.svc", JSONGenerator1.ToPrettyString(2).GetBytes("UTF8"))
Sub hc_ResponseSuccess (Response As HttpResponse, TaskId As Int)
..
End Sub
Sub hc_ResponseError (Response As HttpResponse, Reason As String, StatusCode As Int, TaskId As Int)
..
End Sub
As usual, I really appreciate all of your assistance!
Regards,
Laurence