ProjectMeniscus/pywebhdfs — pull request #5 by waliaashish85 (2013-10-23 16:28:11+00:00)
Title: Fix for WebHDFS API complaint during create file operation: Data upload ...

>>> from pywebhdfs.webhdfs import PyWebHdfsClient
>>> hdfs = PyWebHdfsClient(host='ubuntu@ec2-XXX-X.compute-1.amazonaws.com',port='14000', user_name='httpfs')
>>> my_data = "TESTING TESTING"
>>> my_file = 'user/importer/ashish.txt'
>>> hdfs.create_file(my_file, my_data, overwrite=True)

pywebhdfs.errors.BadRequest: HTTP Status 400 - Data upload requests must have content-type set to 'application/octet-stream

PS: I have setup httpfs on namenode, so instead of using port 50070, I am using port 14000 in creating PyWebHdfsClient