HttpxxxClob

Discussions related to HTTPAPI (An HTTP Client Package for RPG programming.) http://www.scottklement.com/httpapi/
Post Reply
bcisne
Posts: 2
Joined: Tue May 31, 2022 7:16 pm

HttpxxxClob

Post by bcisne »

I can use HttpPostClob to get logged-in to a server, ie. get a bearer token for the session but an api call to post a phone, address, etc, fails, unauthorized.
Then i use scott's http_string procedure, it works, same api, same token, etc, etc.
then I call the same api via httppostclob and it works.
I wrote a little test program that I submit every minute to do this.
After the initial failure then the call to http_string, the httppostclob works for 15 minutes.

does anyone know what http_string could be setting that last for 15 minutes?

Any idea will be greatly appreciated

thanks
bcisne
Posts: 2
Joined: Tue May 31, 2022 7:16 pm

Re: HttpxxxClob

Post by bcisne »

another guy figured out the authorization error. My bad.
I was sending this:
<httpHeader><header name="Content-Type" value="application/JSON"/> Bearer {{token}}</httpHeader>

 but it should have been:
<httpHeader><header name="Content-Type" value="application/JSON"/> <header name="Authorization" value="Bearer {{token}}"/></httpHeadeer>

Now we think that there is a bug on the server side, since the bad one worked after a good api call using http_string, which built it's own version of the httpheader and not my global variable "{{baseheader}}.

The reason for the 15 minutes intervals: that's the time limit the server allows for a token.

cheers
Post Reply