Skip to content
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

Closed
wants to merge 12 commits into from
Closed

Batch Requests #371

wants to merge 12 commits into from

Conversation

ahageali
Copy link

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!

//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.

@ryanseys
Copy link
Contributor

Please add tests to cover this functionality.

@ahageali
Copy link
Author

ahageali commented Mar 8, 2015

Implemented support for streams as the request body and also multipart requests.
Tried to test using the upload API but found out (much) later that uploads are not supported through batch requests, so I'm not sure if any API actually exists that allows uploads while still being supported by batch 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.

…es not support uploading files and/or anything else that uses streams through batch requests
@ahageali
Copy link
Author

I have removed both multipart-stream and memorystream modules, and gotten rid of any support in the batch method for streams.

assert(!result);
scope.done();
done();
});

This comment was marked as spam.

@blackrabbit99
Copy link

@ryanseys so what is your politics with batches requests? Is it going to add into node js client or no.
I've several thousands requests and it works awful. Or do you recommend to use third party libs or maybe this branch as temporary decision

@ryanseys
Copy link
Contributor

I no longer make big decisions with regard to this library, sorry. Please direct all future questions to @tbetbetbe. Thank you.

@jokesterfr
Copy link

Hi, any news from this? Any plan to add this kind of feature in the project?
Thank you

@blackrabbit99
Copy link

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.
Take a look https://github.com/blackrabbit99/google-drive-batch-requests

It works with drive api now. It's not so hard to implement batch support for others api types based on http stack.

@raz3r
Copy link

raz3r commented Aug 29, 2016

Is there any reason why this library doesn't support batch requests? Some APIs such as Directory API are quite useless without batch support...

@JustinBeckwith
Copy link
Contributor

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!

@grant
Copy link
Contributor

grant commented Mar 6, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants