So I'm doing the request:
curl -i https://one.nhtsa.gov/webapi/api/SafetyRatings/modelyear/undefined/make/Ford/model/Fusion\?format\=json
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8
SSL-TLS: TLSv1.2
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 163
Date: Mon, 04 Jun 2018 00:31:15 GMT
Connection: keep-alive
Set-Cookie: NHTSA=2585027594.20480.0000; path=/; Httponly; Secure
Set-Cookie: NHTSA=3323225098.47873.0000; path=/; Httponly; Secure
Strict-Transport-Security: max-age=31536000
-....
This response with and 400
error using Content-Encoding: gzip
. I'm doing this with javascript/node, also request-promise but still not sure how to "uncompress' its message
.
var rp = require('request-promise');
function getVehicles(year, manufacturer, model) {
var options = {
uri: `https://one.nhtsa.gov/webapi/api/SafetyRatings/modelyear/${year}/make/${manufacturer}/model/${model}`,
qs: {
format: 'json'
},
json: true
};
return rp(options);
}