7

I am using hadoop apache 2.7.1 on centos 7 and I want to delete a file(file1) by using webhdfs commands.

curl -i -x DELETE "http://192.168.25.21:50070/webhdfs/v1/hadoophome/file1/?user.name=root&op=DELETE&recursive=true"

But I am getting this error:

curl: (5) Could not resolve proxy: DELETE; Unknown error

I edited bashrc file as following :

export http_proxy=""
export https_proxy=""
export ftp_proxy=""

And source the file to save changes

 source ~/.bashrc

But with the same error.

So I tried to set no proxy in the culr command as

curl -i -x --noproxy localhost  DELETE "http://192.168.25.21:50070/webhdfs/v1/hadoophome/file1/?user.name=root&op=DELETE&recursive=true"

With this error:

curl: (5) Could not resolve proxy: --noproxy; Unknown error

What should I edit to exclude this proxy?

Thanks.

Elydasian
  • 2,016
  • 5
  • 23
  • 41
oula alshiekh
  • 843
  • 5
  • 14
  • 40

1 Answers1

21

-x stands for proxy. You should be using -X to specify the request method.

So the command would be,

curl -i -X DELETE "http://192.168.25.21:50070/webhdfs/v1/hadoophome/file1/?user.name=root&op=DELETE&recursive=true"

Refer curl(1) for options.

franklinsijo
  • 17,784
  • 4
  • 45
  • 63