Hello
I wanted to use the OkHTTPUtils library to POST to an API.
This is the code I use:
This works, but when I check the transmitted packets via Wireshark I notice that the data is not send "raw" but rather via x-www-form-urlencoded.
How can I POST a string to a URL "raw", or how to set the content-type of a POST request?
Thanks
I wanted to use the OkHTTPUtils library to POST to an API.
This is the code I use:
B4X:
Dim j As HttpJob
j.Initialize("", Me)
Dim json As JSONGenerator
json.Initialize(CreateMap("Username":"admin", "Password":"admin"))
j.PostString("http://localhost:10601/session", json.ToString)
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
Log(j.GetString)
End If
j.Release
This works, but when I check the transmitted packets via Wireshark I notice that the data is not send "raw" but rather via x-www-form-urlencoded.
How can I POST a string to a URL "raw", or how to set the content-type of a POST request?
Thanks