hello all !
I'm trying to make a request to an API using httpjob and I'm having an "unknown" error, see the clues below :
with the same information I put in postman , am I doing something wrong ?
I'm trying to make a request to an API using httpjob and I'm having an "unknown" error, see the clues below :
B4X:
Dim j As HttpJob
j.Initialize("", Me)
j.PostString("https://pay.api","") 'the request parameter is empty as it has no importance in this case as the errors are about the headers ...
' ######
' if I comment out the 2 lines below that are setting headers, I get a "coherent" result
' result : ResponseError. Reason: Forbidden, Response: {"HasError":true,"ErrorCode":"403","Error":"It was not possible to authenticate with the informed parameters."}
' if I uncomment the headers, I get an "unknown" error from the API
' result : ResponseError. Reason: Bad Request, Response: {"HasError":true,"ErrorCode":"999","Error":"An uncataloged error has occurred. ","RequestId":"d2xx-xxx-xxxx-xxxxx-xxxxx"}
' ######
' j.GetRequest.SetHeader("X-API-KEY", "XXXXXXXXXXXXXXXXXXXXXXXXXXX")
' j.GetRequest.SetHeader("content-type", "application/json")
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
Log(j.GetString)
End If
j.Release
with the same information I put in postman , am I doing something wrong ?