-
David Pylatuk
- PowerBuilder
- Monday, 26 January 2026 02:38 PM UTC
I am using PB 2019 R3 Build 2803, my code follows and a description of the problem at the end...
/////////////////////// BEGINNING OF CODE //////////////////////////////////////////////////
HTTPClient lnv_http
lnv_http = CREATE HTTPClient
string ls_json
string ls_response
long ll_status
blob lb_json
long ll_statusCode
string ls_responseBody
lb_json = Blob(ls_json, EncodingUTF8!)
lnv_http.SetRequestHeader("Content-Type", "application/json")
lnv_http.SetRequestHeader("Accept", "application/json")
ll_status = lnv_http.SendRequest("POST", "https://nissan.corp.toronto.ca:6810/ewms/racs/createPermit", lb_json)
lnv_http.GetResponseBody(ls_response)
long ll_http_code
ll_http_code = lnv_http.GetResponseStatusCode()
blob lb_response
lnv_http.GetResponseBody(lb_response)
ls_response = String(lb_response) // Convert blob to string
/////////////////////// END OF CODE ///////////////////////////////////////////////////////
The issue is I am receiving status codes and response body back that makes no sense. I know my .json is correct, developers at the other end receive the .json payload successfully and it matches mine perfectly.
1. I receive -4 from this (always)
ll_status = lnv_http.SendRequest("POST", "https://nissan.corp.toronto.ca:6810/ewms/racs/createPermit", lb_json)
2. ls_response from this is always empty string ""
lnv_http.GetResponseBody(ls_response)
3. ll_http_code = lnv_http.GetResponseStatusCode()
This is always -1
4. lnv_http.GetResponseBody(lb_response)
ls_response = String(lb_response) // Convert blob to string
This always returns empty string ""
So if I send corrupt JSON or make up a nonsensical url for the call the return values are identical to what they are when the call succeeds. The issue is I can never reliably know if the call succeeded since the responses are always identical.
Has anyone else experienced this?
Thanks in advance.
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.