-
Notifications
You must be signed in to change notification settings - Fork 535
Inconsistent response from JSON-RPC GET method #657
Comments
Just to enrich the conversation. I think you could consider not handling HTTP GET method because in fact JSON-RPC expects a data object, meaning that it must be an HTTP POST. Here's the spec https://www.jsonrpc.org/specification just in case you want to review it, but I'm sure you know it very well. |
Hey @inglkruiz, Thank you for opening up the issue. Would you find it useful if the |
Yes, I would. Possibly, other details might come handy, like the node's version. TBH I'm fine with anything as long as the response is a parseable JSON Object because the Header |
Got it @inglkruiz, thank you for the quick reply. I've talked with the team and decided that this makes sense - we've added it to the development pipeline. Letting you know here as soon as we have it up on a PR 🙏 |
|
Hey @mrwillis, Not necessary at all to remove it. Seeing as we can't reach a conclusion on the PR, I will keep the |
@mrwillis I would not say that GET As a reference, you could check Hyperledger Fabric common library and here the |
Inconsistent response from JSON-RPC GET method
Description
While testing the JSON-RPC endpoints I decided to run
I was expecting a JSON response in a middleware I built but what I got was a plain text (not parseable to a JSON object), I went directly to repo's code and found this > https://github.com/0xPolygon/polygon-edge/blob/develop/jsonrpc/jsonrpc.go#L248-L252
This is not a big Issue but I'd suggest standardizing the response, and document it here > https://docs.polygon.technology/docs/edge/get-started/json-rpc-commands
Your environment
develop
Steps to reproduce
You will see the response is a String that is not parseable to a JSON Object.
Expected behaviour
If the
Content-Type
is set toapplication/json
> https://github.com/0xPolygon/polygon-edge/blob/develop/jsonrpc/jsonrpc.go#L237 I would expect a JSON Object.Actual behaviour
The response is just a plain text.
Logs
NA
Proposed solution
I'd suggest standardizing the response, and document it here > https://docs.polygon.technology/docs/edge/get-started/json-rpc-commands
The text was updated successfully, but these errors were encountered: