mystery cookie being sent in the header
Posted: Wed Aug 21, 2024 11:57 pm
I am attempting to retrieve an Oauth 2.0 token. About half the time it works fine. Then, seemingly randomly, I start getting Error 400 bad request returned. This is my request
The response I am getting is:
This lead me to look at httpapi_debug.txt and there is a cookie header being sent that I am never specifying. It is only there when the request fails.
Where is this coming from and how do I get rid of it?
Code: Select all
http_setCCSIDs(1208: 0);
http_debug(*ON);
http_xproc( HTTP_POINT_ADDL_HEADER : *NULL);
authparms = 'grant_type=client_credentials&client_id='+
%trim(facid)+'&client_secret='+%trim(facsec);
if http_req('POST'
: %trim(faurl1)+'/oauth2/v3/token'
: *omit
: RSP
: *omit
: %trim(authparms)
: 'application/x-www-form-urlencoded') <> 1
errmsg = http_error(errno:result);
endif;
Code: Select all
{"fault":{"faultstring":"OASValidation OpenAPI-Spec-Validation-OAuth2 with resource \"oas:\/\/oauth2-3_0_2.yaml\": failed with reason: \"[ERROR - cookie parameter is unexpected : NSC_fnbt-bqj-dbu: [], ERROR - cookie parameter is unexpected: $Path: [], ERROR - cookie parameter is unexpected : $Version: []]\"","detail":{"errorcode":"steps.oasvalidation.Failed"}}}
Code: Select all
There are 1 cookies in the cache
POST /oauth2/v3/token HTTP/1.1
Host: api-cat.usps.com
User-Agent: http-api/1.45
Content-Type: application/x-www-form-urlencoded
Content-Length: 103
Cookie: $Version=0; NSC_fnbt-bqj-dbu=ffffffff3b449a5145525d5f4f58455e445a4a42378b; $Path=/;
Where is this coming from and how do I get rid of it?