- Piero Salandin
- PowerBuilder
- Wednesday, 19 July 2023 12:31 PM UTC
Hi there!
In PowerBuilder 2019 R3 I am using a "normal" HttpClient object to access a service fulkly accessible by PostMan, but from PowerBuilder I get an undocumented return code of 3. Not -3, but +3 instead.
The main problem is to understand what does that "3" return value stand for.
I really don't know how to do.
The postman call is very simple:
- POST
- Normal default headers, content-type is application/json
- the body is {"parentId": 5097,"onlyFolders": true}
- there is a basic authorization
The PowerBuilder Code is the following:
// is_auth_token is the basic authorization token
// is_useragent is a normal string, I tried aklso with the Postman's one
// ls_url is the url with which I connect with PostMan too
ls_json = '{"parentId": 5097,"onlyFolders": true}'
ll_len = Len(ls_json)
lnv_http = create httpClient
lnv_http.ClearRequestheaders()
lnv_http.Timeout = 5
lnv_http.SetRequestheader("Accept", "application/json")
lnv_http.SetRequestheader("Connection", "keep-alive")
lnv_http.SetRequestheader("Content-Type", "application/json")
lnv_http.SetRequestheader("Content-Length", String(ll_len))
lnv_http.SetRequestheader("User-Agent", is_useragent)
lnv_http.SetRequestheader("Authorization","Basic "+is_auth_token)
li_rc = lnv_http.SendRequest("POST", ls_url, ls_json)
Best regards
Piero Salandin
Office Information Technologies
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.