We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, I just upgraded to v2.48.0 and my request to the Google API broke. Compare the following:
In 2.47.0, the following request returns the expected response ("Unauthorized"):
$ npm install request@2.47.0 $ node > require('request')({ ... method: 'POST', ... url: 'https://www.googleapis.com/batch', ... multipart: [{ ..... 'Content-Type': 'application/http', ..... 'body': 'GET https://www.googleapis.com/gmail/v1/users/me/messages/asdf\n' ..... }], ... headers: { ..... 'content-type': 'multipart/mixed' ..... } ... }, function(err, response) { ... console.log(err, response.body); ... }); > null '--batch_ODl35evuJ0c_AAJlyu9-hb4\r\nContent-Type: application/http\r\n\r\nHTTP/1.1 401 Unauthorized\r\nWWW-Authenticate: Bearer realm="https://accounts.google.com/AuthSubRequest"\r\nContent-Type: application/json; charset=UTF-8\r\nDate: Tue, 18 Nov 2014 07:44:24 GMT\r\nExpires: Tue, 18 Nov 2014 07:44:24 GMT\r\nCache-Control: private, max-age=0\r\nContent-Length: 238\r\n\r\n{\n "error": {\n "errors": [\n {\n "domain": "global",\n "reason": "required",\n "message": "Login Required",\n "locationType": "header",\n "location": "Authorization"\n }\n ],\n "code": 401,\n "message": "Login Required"\n }\n}\n\r\n--batch_ODl35evuJ0c_AAJlyu9-hb4--\r\n'
The same request in v2.48.0 returns "Invalid value" from the Google API:
$ npm install request@2.48.0 $ node > require('request')({ ... method: 'POST', ... url: 'https://www.googleapis.com/batch', ... multipart: [{ ..... 'Content-Type': 'application/http', ..... 'body': 'GET https://www.googleapis.com/gmail/v1/users/me/messages/asdf\n' ..... }], ... headers: { ..... 'content-type': 'multipart/mixed' ..... } ... }, function(err, response) { ... console.log(err, response.body); ... }); > null 'Invalid value for header Content-Type: multipart/related; boundary=910e28a4-1de0-4562-aa4e-7fd88d09d10f'
I tried using the new chunked setting to no avail:
chunked
multipart: { chunked: false, data: [{ 'Content-Type': 'application/http', 'body': 'GET https://www.googleapis.com/gmail/v1/users/me/messages/asdf\n' }] },
The text was updated successfully, but these errors were encountered:
@bradvogel I just pushed a fix 👍
In the meantime you can use request v2.47 as this bug was introduced in v2.48
Sorry, something went wrong.
Cool thanks, when will 2.49.0 be out?
I guess in a couple of days at most.
Successfully merging a pull request may close this issue.
Hi, I just upgraded to v2.48.0 and my request to the Google API broke. Compare the following:
In 2.47.0, the following request returns the expected response ("Unauthorized"):
The same request in v2.48.0 returns "Invalid value" from the Google API:
I tried using the new
chunked
setting to no avail:The text was updated successfully, but these errors were encountered: