hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Nauroth <cnaur...@hortonworks.com>
Subject Re: Http request uri query parameters of the redirected location
Date Tue, 13 Oct 2015 03:21:14 GMT
Hello Jingfei,

Yes, the relevant query parameters are included in the redirect location of the HTTP 302 response,
and this is by design.

Many of the curl examples in the WebHDFS documentation use the curl -L option.


Passing the -L option to the curl command will cause it to follow redirects automatically.
 We expect this would work correctly, because the redirect location in the HTTP 302 response
has the complete query parameter information, and curl -L would use this in its subsequent
HTTP request.

--Chris Nauroth

From: Jingfei Hu <jingfei_hu@hotmail.com<mailto:jingfei_hu@hotmail.com>>
Reply-To: "user@hadoop.apache.org<mailto:user@hadoop.apache.org>" <user@hadoop.apache.org<mailto:user@hadoop.apache.org>>
Date: Monday, October 12, 2015 at 6:53 PM
To: "user@hadoop.apache.org<mailto:user@hadoop.apache.org>" <user@hadoop.apache.org<mailto:user@hadoop.apache.org>>
Cc: Jingfei Hu <jingfei_hu@hotmail.com<mailto:jingfei_hu@hotmail.com>>
Subject: Http request uri query parameters of the redirected location

Hi team,
I am using WebHDFS rest api to read from and write to HDFS cluster files. I've got a minor
question when using curl command line to practice some apis.  It's

Would the query parameters be appended to the redirected location when creating files or any
other apis which needs a redirect?

Of course, I tried out. And it seems work in that way.

curl -i -X PUT "http://xxx:50070/webhdfs/v1/hellowworld?op=CREATE

If I put it a &user.name=hadoop, then the redirected location would also contain such
a query parameter.

My further question is it's by design or not. Can I make this assumption when writing codes?


View raw message