Still experiencing 501 response code while batching
See original GitHub issueWhile batching queries to manipulate GSheets, we encounter a 501 error.
The documentation shows that it is indeed supported: https://developers.google.com/api-client-library/dotnet/guide/batch?hl=fr
Someone with python library also encountered this error: https://github.com/googleapis/google-api-python-client/issues/2085
I was curious to read that it has been encountered and fix in the past: https://github.com/googleapis/google-api-dotnet-client/issues/1634
Environment details
- Programming language: .NetCore 6
- OS: Windows
- Language runtime version:
- Package version: Google.Apis 1.57.0.0
Steps to reproduce
- While trying to batch queries for GoogleSheet
- the execution of each individual request works
- Followed the documentation to batch all the request by making use of
Queue()
- Code is similar to
SheetsService curSheetsService = new SheetsService(new Google.Apis.Services.BaseClientService.Initializer()
{
ApplicationName = "",
HttpClientInitializer = credentials.First(),
});
Google.Apis.Requests.BatchRequest batchRequests = new Google.Apis.Requests.BatchRequest(curSheetsService);
string range = "Input - OFFER" + "!" + "A1" + ":" + "A10";
SpreadsheetsResource.ValuesResource.ClearRequest clearRequest = curSheetsService.Spreadsheets.Values.Clear(null, "1NBTwhG7K6uTag8XC9sLM8EmbigY0mJ6KYwUd1Vh8baY", range);
var response = await clearRequest.ExecuteAsync(); // <- this works
batchRequests.Queue<ClearValuesResponse>(clearRequest, (content, error, index, message) =>
{
logger.LogInformation(error.ToString()); // <- would fail here with message 501 not implemented, not supported o
});
await batchRequests.ExecuteAsync(); // <- this would NOT works
- Reponse for batch execution is
{
"error": {
"code": 501,
"message": "Operation is not implemented, or supported, or enabled.",
"errors": [
{
"message": "Operation is not implemented, or supported, or enabled.",
"domain": "global",
"reason": "notImplemented"
}
],
"status": "UNIMPLEMENTED"
}
}
Thanks for getting back to me
Issue Analytics
- State:
- Created 5 months ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
new_http_batch_request throwing 501:"Operation is not ...
I am trying to get google worksheet information in a batch call but getting the ... Still experiencing 501 response code while batching...
Read more >How to Fix the HTTP 501 Not Implemented Error on Your Site
The HTTP 501 Not Implemented status code indicates that the server does not support the functionality required to fulfill the request.
Read more >501 Not Implemented - HTTP - MDN Web Docs
501 is the appropriate response when the server does not recognize the request method and is incapable of supporting it for any resource....
Read more >What Is a 501 Not Implemented Error (and How to Fix It)
A “501 Not Implemented” error occurs when a website you visit lacks the functionality to retrieve or show information that your web browser ......
Read more >How to Fix the HTTP Error Code 501
The important thing to recognize is that when receiving a 501 error, the user has done nothing wrong. It is entirely server-based, and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s flag as external as this is an issue with the API and not with the .NET client library. I’m still confirming my suspicions so I can give you a good answer. I’ll update here when I know more.
Assigned to Amanda as she looked at this last time and may have insight into what’s happening.