HTTP 400 Bad Request
Posted: Thu Apr 11, 2024 5:42 am
Good Afternoon.
I'm trying to call an API that uses a query parameter that must be enclosed in single quotes - something I've never needed to do previously...
I'm getting a 400 error (Invalid character found in the request target).
I'm sure there is a way around this and can see that the UTF-8 character is %27 but not sure how to use it correctly.
I have tried adding this prior to the http_req, then using %27 but can't seem to get around the 400 issue or find any examples of how to do this properly.
Any pointers will be greatly appreciated.
btw using HTTPAPI 1.48
Thank you.
I'm trying to call an API that uses a query parameter that must be enclosed in single quotes - something I've never needed to do previously...
Code: Select all
URL = https://www4.wastedge.com/api/rest/customer/customer?query=update_timestamp>='2024-04-10T00:00:00';
rc = http_req('GET' : URL : *omit : response );
I'm sure there is a way around this and can see that the UTF-8 character is %27 but not sure how to use it correctly.
I have tried adding this prior to the http_req, then using %27 but can't seem to get around the 400 issue or find any examples of how to do this properly.
Code: Select all
http_setCCSIDs(1208: 0);
URL = https://www4.wastedge.com/api/rest/customer/customer?query=update_timestamp>=%272024-04-10T00:00:00%27;
rc = http_req('GET' : URL : *omit : response );
btw using HTTPAPI 1.48
Thank you.