How can I use wget to send POST data?

I want to make following POST request to my server using wget:

email=&file1=@FILE_HERE&file2=@FILE_HERE

In the above request, there are three POST parameters called email , file1 and file2 where email contains email of user and file1 , file2 contain a file.

How can I send it using wget? I don't want to use curl.

0

2 Answers

Use the --post-data parameter.

So your command will end with:

--post-data "email=&file1=@FILE_HERE&file2=@FILE_HERE"

Another method is to put your data in a file. For example, if you saved a file called params.txt as:

email=
file1=@FILE_HERE
file2=@FILE_HERE

You could use --post-file params.txt

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like