Page 1 of 1

Bad Request

Posted: Fri May 26, 2023 2:34 pm
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:
.
.
.

Re: Bad Request

Posted: Fri May 26, 2023 5:17 pm
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".

Re: Bad Request

Posted: Fri May 26, 2023 9:54 pm
by juan11de14
I am very sorry, I realized that I had a wrong HEADER, I was able to consume correctly.
Thank you,