New issue
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
Batch Requests #371
Batch Requests #371
Conversation
//if there is a query string, append it to the end of the path | ||
if (request.useQuerystring && request.qs) { | ||
var firstTime = true; | ||
for (var key in request.qs) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Please add tests to cover this functionality. |
Implemented support for streams as the request body and also multipart requests. I've also implemented some tests, though I'm not sure if they cover the functionality properly as I'm actually pretty new to node and haven't gotten into testing yet. Is it alright if the tests make real API calls, as emulating the requests/responses is tough due to the unique nature of the batch requests / responses. |
@@ -35,6 +35,10 @@ | |||
"dependencies": { | |||
"async": "~0.9.0", | |||
"gapitoken": "~0.1.2", | |||
"http-string-parser": "0.0.4", | |||
"memorystream": "^0.3.1", | |||
"multipart-stream": "^1.0.0", |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
…es not support uploading files and/or anything else that uses streams through batch requests
I have removed both |
assert(!result); | ||
scope.done(); | ||
done(); | ||
}); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@ryanseys so what is your politics with batches requests? Is it going to add into node js client or no. |
I no longer make big decisions with regard to this library, sorry. Please direct all future questions to @tbetbetbe. Thank you. |
Hi, any news from this? Any plan to add this kind of feature in the project? |
Looks like google team decided not support batch activity into their nodeJS library due to some reason. I found it as a big issue for my project so make some part of batch api. It works with drive api now. It's not so hard to implement batch support for others api types based on http stack. |
Is there any reason why this library doesn't support batch requests? Some APIs such as Directory API are quite useless without batch support... |
Greetings! And thanks for the contribution. Sadly - this PR has gotten really stale :( We're taking steps to respond to these in a more timely fashion to prevent this from happening in the future. Apologies! |
Note: It also looks like global HTTP batch endpoints (www.googleapis.com/batch) will cease to work on March 25, 2019 anyways. https://developers.googleblog.com/2018/03/discontinuing-support-for-json-rpc-and.html |
While experimental, I have tested this through the use of urlshortener apis and drive apis and this does appear to work for normal GET and POST requests. I have also added some documentation to provide a simple way to call the batch api. As a result however, the api requests no longer actually make their requests when they are called without a callback.
I have also tried to keep as similar a style as possible to all the pre-existing code so I apologize if I made any horrendous mistakes. Let me know if you want any changes!