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

Unsupported media type #15

Open
heikoheiko opened this issue Aug 13, 2016 · 3 comments
Open

Unsupported media type #15

heikoheiko opened this issue Aug 13, 2016 · 3 comments

Comments

@heikoheiko
Copy link

Hi, when trying to access via http i get "Unsupported media type" as a return value.
running with ethersim

from pyethapp import rpc_client
c = rpc_client.JSONRPCClient(8101)
c.blocknumber()

sent:
{
  "jsonrpc": "2.0", 
  "method": "eth_blockNumber", 
  "id": 6
}
received:
Unsupported media type

this works when using geth or pyethapp.

I tried with web3.py as well.

@agatsoh
Copy link

agatsoh commented Aug 15, 2016

While testing with web3.py ((https://github.com/pipermerriam/web3.py )) we get this error

(envflask) krishna@Krishna:~$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from web3 import Web3, RPCProvider, IPCProvider
>>> web3rpc = Web3(RPCProvider(host="localhost", port="8101"))
>>> web3rpc.eth.coinbase
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/krishna/Envs/envflask/local/lib/python2.7/site-packages/web3/eth.py", line 62, in coinbase
    return self.request_manager.request_blocking("eth_coinbase", [])
  File "/home/krishna/Envs/envflask/local/lib/python2.7/site-packages/web3/providers/manager.py", line 22, in request_blocking
    response = json.loads(force_text(response_raw))
  File "/usr/lib/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

@pipermerriam
Copy link

pipermerriam commented Aug 15, 2016

This was an issue with web3.py not sending a content-type header which was fixed with https://github.com/pipermerriam/web3.py/pull/67 and is available as 1.8.0 from pypi or within the releases section of the repository.

@heikoheiko
Copy link
Author

needs to be fixed in pyethapp too
ethereum/pyethapp#164

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

No branches or pull requests

3 participants