Hello friends,
I'm trying to address a WEB service with an httpclient-object and the get-method, but I always get the status message 401.
I'm using the following code:
HttpClient lnv_HttpClientlnv_HttpClient = Create HttpClient
string ls_uer, ls_token, ls_string
integer li_status, li_req
ls_token = 'long_given_token_x'
lnv_HttpClient.SetRequestHeader("Host", "pp.xx.qwertz.com")
li_req = lnv_HttpClient.SetRequestHeader('qwertz-ConsumerId', ls_user)
li_req = lnv_HttpClient.SetRequestHeader('qwertz-ConsumerToken', ls_token)
li_req = lnv_HttpClient.SendRequest('GET', 'https://pp.xx.qwertz.com/pp/employeeGet')
if li_req = 1 then
li_status = lnv_HttpClient.GetResponseStatusCode()
if li_status = 200 then
lnv_HttpClient.GetResponseBody(ls_string)
end if
end if
the same procedure from the same Client-PC works fine when i'am using the extern API-Tool "Postman"
So, what i'am doing wrong?
greetings
Andreas
Hi, thanks for responding,
with c# it works fine with the given haeder - credentials.
with PB 2022 it is still not working an and i have no idea why.
greeting
Andreas