This is the documentation for CDH 5.1.x. Documentation for other versions is available at Cloudera Documentation.

Using the HttpFS Server with curl

You can use a tool such as curl to access HDFS via HttpFS. For example, to obtain the home directory of the user babu, use a command such as this:

$ curl "http://localhost:14000/webhdfs/v1?op=gethomedirectory&user.name=babu"

You should see output such as this:

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Set-Cookie: hadoop.auth="u=babu&p=babu&t=simple&e=1332977755010&s=JVfT4T785K4jeeLNWXK68rc/0xI="; Version=1; Path=/
Content-Type: application/json
Transfer-Encoding: chunked
Date: Wed, 28 Mar 2012 13:35:55 GMT

{"Path":"\/user\/babu"}

See the WebHDFS REST API web page for complete documentation of the API.

Page generated September 3, 2015.