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

graphql: set content-type as json #28417

Merged
merged 2 commits into from
Oct 27, 2023
Merged

Conversation

jsvisa
Copy link
Contributor

@jsvisa jsvisa commented Oct 26, 2023

Fix an issue of wrong Content-Type

$ curl -XPOST 127.0.0.1:8545/graphql -d '{"query": "{block(number: 1  hash: \"0xc1d1224983a2b43f2ea1b847337eda55e316e94603386e346abe3f6e08121027\") {number hash }}"}' -v
Note: Unnecessary use of -X or --request, POST is already inferred.
* Connected to 127.0.0.1 (127.0.0.1) port 8545 (#0)
> POST /graphql HTTP/1.1
> Host: 127.0.0.1:8545
> User-Agent: curl/8.1.2
> Accept: */*
> Content-Length: 124
> Content-Type: application/x-www-form-urlencoded
>
< HTTP/1.1 400 Bad Request
< Date: Thu, 26 Oct 2023 00:29:18 GMT
< Content-Length: 110
< Content-Type: text/plain; charset=utf-8
<
* Connection #0 to host 127.0.0.1 left intact
{"errors":[{"message":"only one of number or hash must be specified","path":["block"]}],"data":{"block":null}}

@s1na PTAL

Signed-off-by: jsvisa <delweng@gmail.com>
Signed-off-by: jsvisa <delweng@gmail.com>
@jsvisa jsvisa requested a review from s1na as a code owner October 26, 2023 00:35
@fjl fjl merged commit 2d7dba0 into ethereum:master Oct 27, 2023
1 of 2 checks passed
@fjl fjl added this to the 1.13.5 milestone Oct 27, 2023
@jsvisa jsvisa deleted the graphql-content-type branch October 27, 2023 22:33
devopsbo3 pushed a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
---------

Signed-off-by: jsvisa <delweng@gmail.com>
devopsbo3 added a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
devopsbo3 added a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
Dergarcon pushed a commit to specialmechanisms/mev-geth-0x2mev that referenced this pull request Jan 31, 2024
---------

Signed-off-by: jsvisa <delweng@gmail.com>
colinlyguo pushed a commit to scroll-tech/go-ethereum that referenced this pull request Oct 31, 2024
---------

Signed-off-by: jsvisa <delweng@gmail.com>
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.

2 participants