Simple query to an API, the curl request works, but fails when I try to utilize the request NPM module to perform the request.
Curl:
curl "https://api.squarespace.com/1.0/commerce/orders?modifiedAfter=2019-11-01T12:00:00Z&modifiedBefore=2019-11-15T12:00:00Z" \
-H "Authorization: Bearer abcde"
Request:
const response = await request({
method: 'GET',
uri:
'https://api.squarespace.com/1.0/commerce/orders?modifiedAfter=2019-11-01T12:00:00Z&modifiedBefore=2019-11-15T12:00:00Z',
headers: {
Authorization: 'Bearer abcde'
}
});
Request succeeded with curl, immediate error with request js reporting status code 400. Can you tell me what is amiss with my request usage, and how it even differs from the request generated by curl?
Latest version of request is being used.