0

Hadoop offers a REST API using curl. For some reason, I need to use httplib but not pycurl.

Can you translate this request to httplib? The test.txt local file should be transmitted by HTTPConnection.send(data), as I need transmit the file by chunk.

curl -i -X PUT -T test.txt "http://www.SomeDomain.com/webhdfs/v1/levi/test.txt?op=CREATE"
Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Levi
  • 55
  • 3
  • 8
  • 1
    We could, but we don't do it on SO. Show us what you've done so far and what you're stuck on, then someone will help :) – Piotr Hajduga Apr 08 '13 at 09:38
  • 1
    *For some reason, i need to use httplib*. *Why* do you need to use `httplib`? You can't use, say, `requests` instead? – Martijn Pieters Apr 08 '13 at 09:41
  • Thanks. the reason is that, my program need to get the requests from a client, then send the data to another(Hadoop), and the data is sent by chunk. So i need use the HTTPConnection.send(data). Can i acheive it by pycurl? in fact, i submit my question in detail here. http://stackoverflow.com/questions/15870381/i-want-to-call-hdfs-rest-api-to-upload-a-file – Levi Apr 08 '13 at 09:48

0 Answers0