JSON RPC response comes back with extra character

When I send a cURL request to the infura api for Kovan, Rinkeby, and Mainnet I receive the expected response however it comes back with a “%” symbol appended to the end. Does anyone know why this might be happening?

cURL request,

 $ curl -X POST \
-H "Content-Type: application/json" \
--data '{"jsonrpc": "2.0", "id": 1, "method": "eth_blockNumber", "params": []}' \

Result (note the % symbol at the end of the response


Hi @cochise - welcome to the Infura community! I’m not able to reproduce this error on my end - how frequently is it happening for you?
It doesn’t appear to have affected the response coming through, however, so I think it may be okay to ignore if it happens again in the future. That’s definitely odd, though!

It’s happening every time I make the request and I was thinking maybe it’s not an Infura issue, However I’m using infura for setting up a chainlink node and the chainlink node is not able to parse my response from kovan. That’s why I tried the cURL request and saw the % appended to the end. Wasn’t sure if I was missing something or not

As a follow up for anyone who sees this question, I found out it’s not an Infura issue, it happened when cURLing an unrelated api, seems like something with my environment either the terminal or my OS

Thanks for following up!

Hello cochise,

curl does not add a line break to the output, so the % you are seeing is probably your bash prompt.

Depending on your version of curl you can add -w \\n to your curl command to tell it to output an extra newline at the end of the response, or use the echo shell builtin like so:

$ curl -X POST \
-H "Content-Type: application/json" \
--data '{"jsonrpc": "2.0", "id": 1, "method": "eth_blockNumber", "params": []}' \
"https://kovan.infura.io/v3/{projectId}" && echo
1 Like