Bad Request

Discussions related to HTTPAPI (An HTTP Client Package for RPG programming.) http://www.scottklement.com/httpapi/
Post Reply
juan11de14
Posts: 7
Joined: Mon May 08, 2023 3:50 pm

Bad Request

Post by juan11de14 »

Good day,
I am trying to consume a service in POST from AS400(RPG) and it generates the following error:

I must say that if I use the same json from python AS400 (open source) I have no problem:

Thanks for your help.

.
.
.
Content-Type: application/json
Accept: application/json


senddoc(): entered
{"authentication":{"login":"RRlmAAAAA","password":"C0x34233*"},"subsidiary":{"code":1},"branch":{"code":1},"role":{"code":1}}
recvresp(): entered
HTTP/1.1 400 Bad Request
Date: Fri, 26 May 2023 14:06:05 GMT
Content-Type: application/json
Content-Length: 78
Connection: keep-alive
Connection: keep-alive
Server: Server
x-amzn-RequestId: df0a61f7-b81f-4fc9-876a-ee1760864942
Accept: application/json; q=1.0
Strict-Transport-Security: max-age="63072000"
Access-Control-Allow-Headers: Content-Type,X-Amz-Date,Authorization,X-Api-Key,x-financial-id,x-end-user-terminal,x-request-id,x-end-
Content-Security-Policy: default-src "none"; img-src "self"; script-src "self"; style-src "self"; object-src "none"
.
.
.

SetError() Ñ13: HTTP/1.1 400 Bad Request
recvresp(): end with 400
recvdoc parms: identity 78
header_load_cookies() entered
recvdoc(): entered
SetError() Ñ0:
.
.
.
jonboy49
Posts: 200
Joined: Wed Jul 28, 2021 8:18 pm

Re: Bad Request

Post by jonboy49 »

If you show us the code you are using we might be able to help. With the current info we can't even guess - beyond saying "you did something wrong".
juan11de14
Posts: 7
Joined: Mon May 08, 2023 3:50 pm

Re: Bad Request

Post by juan11de14 »

I am very sorry, I realized that I had a wrong HEADER, I was able to consume correctly.
Thank you,
Post Reply