No way to pass payload via action() method, but some HTTP routes require a body
See original GitHub issueArangoDB version: 3.3.12 pyArango version: 1.3.1 (via pip)
See https://stackoverflow.com/questions/51362259/rename-collection-with-pyarango
To rename a collection, it is necessary to pass a JSON body {"name":"newname"}
in a PUT request to /_api/collection/<collectionHandle>/rename
. The .action()
method only supports passing on URL path params however.
The HTTP docs also describe that there would be a path parameter ?collection-name=newname
but it is not support anymore (I tried with curl but got errors back about name being empty as if no parameter for name or collection-name was passed).
It would be nice if the action method and possibly others too would support passing a body.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
HTTP GET with request body
Yes, you can send a request body with GET but it should not have any meaning. If you give it meaning by parsing...
Read more >Sending form data - Learn web development | MDN
Because the body is empty, if a form is sent using this method the data sent to the server is appended to the...
Read more >Best practices for REST API design
Learn how to design REST APIs to be easy to understand for anyone, future-proof, secure, and fast since they serve data to clients...
Read more >Accepting Raw Request Body Content in ASP.NET Core API ...
There's no easy way to simply retrieve raw data to a parameter in an API method, so a few extra steps are provided...
Read more >Working with routes for HTTP APIs
For example, you can create an API with only a $default route and integrate it on the ANY method with the https://petstore-demo-endpoint.execute-api.com HTTP...
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
Okay, I will look into it.
Hi @tariqdaouda @Simran-B , Please check the pull request(https://github.com/ArangoDB-Community/pyArango/pull/155) which has the implementation for action in Connection and DB, which can be later used for creating functions which represent the rest apis provided by ArangoDB.