Posting data to a form using curl


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Posting data to a form using curl
# 1  
Old 05-30-2010
Posting data to a form using curl

Hello all.

I have an incredible number of servers that I need to change a parameter on using a web interface. I'd like to be able to do this via curl, but I'm having some trouble. I filled out the form and hit update while snooping (tcpdump) my interface. That gave the the following as what is being posted:

Code:
sink_type=0&sev0typeACE_LOG=on&sev1typeACE_LOG=on&sev2typeACE_LOG=on&sev0typeASSERT=on&sev1typeASSERT=on&sev2typeASSERT=on&sev0typeASYNC=on&sev1typeASYNC=on&sev2typeASYNC=on&sev0typeCM_INTR=on&sev1typeCM_INTR=on&sev2typeCM_INTR=on&sev0typeCOMM_ID=on&sev1typeCOMM_ID=on&sev2typeCOMM_ID=on&sev0typeCONTENT=on&sev1typeCONTENT=on&sev2typeCONTENT=on&sev0typeCOUNT_TIME=on&sev1typeCOUNT_TIME=on&sev2typeCOUNT_TIME=on&sev0typeHTTP_CLIENT=on&sev1typeHTTP_CLIENT=on&sev2typeHTTP_CLIENT=on&sev0typeHTTP_SERVER=on&sev1typeHTTP_SERVER=on&sev2typeHTTP_SERVER=on&sev0typeINGEST=on&sev1typeINGEST=on&sev2typeINGEST=on&sev0typeLIVELIHOOD=on&sev1typeLIVELIHOOD=on&sev2typeLIVELIHOOD=on&sev0typeLOGGING=on&sev1typeLOGGING=on&sev2typeLOGGING=on&sev0typeMEMORY=on&sev1typeMEMORY=on&sev2typeMEMORY=on&sev0typeMETADATA=on&sev1typeMETADATA=on&sev2typeMETADATA=on&sev0typeONLINE_TIM=on&sev1typeONLINE_TIM=on&sev2typeONLINE_TIM=on&sev2typePVFS=on&sev0typePVFS-BITRAT=on&sev1typePVFS-BITRAT=on&sev2typePVFS-BITRAT=on&sev0typePVFS-CACHE=on&sev1typePVFS-CACHE=on&sev2typePVFS-CACHE=on&sev0typePVFS-CDN=on&sev1typePVFS-CDN=on&sev2typePVFS-CDN=on&sev0typePVFS-JOB=on&sev1typePVFS-JOB=on&sev2typePVFS-JOB=on&sev0typePVFS-MNG=on&sev1typePVFS-MNG=on&sev2typePVFS-MNG=on&sev0typePVFS-RAID=on&sev1typePVFS-RAID=on&sev2typePVFS-RAID=on&sev0typeRTSP=on&sev1typeRTSP=on&sev2typeRTSP=on&sev0typeRTSP_SERVER=on&sev1typeRTSP_SERVER=on&sev2typeRTSP_SERVER=on&sev0typeSERIALIZE=on&sev1typeSERIALIZE=on&sev2typeSERIALIZE=on&sev0typeSOCK_POOL=on&sev1typeSOCK_POOL=on&sev2typeSOCK_POOL=on&sev0typeSTATMUX=on&sev1typeSTATMUX=on&sev2typeSTATMUX=on&sev0typeSTREAMER=on&sev1typeSTREAMER=on&sev2typeSTREAMER=on&sev3typeSTREAMER=on&sev4typeSTREAMER=on&sev0typeSTREAMER_IO=on&sev1typeSTREAMER_IO=on&sev2typeSTREAMER_IO=on&sev0typeSTREAM_ERR=on&sev1typeSTREAM_ERR=on&sev2typeSTREAM_ERR=on&sev3typeSTREAM_ERR=on&sev4typeSTREAM_ERR=on&sev0typeSTREAM_PTS=on&sev1typeSTREAM_PTS=on&sev2typeSTREAM_PTS=on&sev0typeSYS_OPER=on&sev1typeSYS_OPER=on&sev2typeSYS_OPER=on&sev3typeSYS_OPER=on&sev4typeSYS_OPER=on&sev0typeUSER_OPER=on&sev1typeUSER_OPER=on&sev2typeUSER_OPER=on&sev3typeUSER_OPER=on&sev4typeUSER_OPER=on&contextinhidden=&contextouthidden=&Update=Update

I'm now trying to reproduce this using curl, but I don't know how. I've tried
Code:
curl -d "sink_type=0&sev0typeACE_LOG=on&sev1typeACE_LOG=on&sev2typeACE_LOG=on&sev0typeASSERT=on&sev1typeASSERT=on&sev2typeASSERT=on&sev0typeASYNC=on&sev1typeASYNC=on&sev2typeASYNC=on&sev0typeCM_INTR=on&sev1typeCM_INTR=on&sev2typeCM_INTR=on&sev0typeCOMM_ID=on&sev1typeCOMM_ID=on&sev2typeCOMM_ID=on&sev0typeCONTENT=on&sev1typeCONTENT=on&sev2typeCONTENT=on&sev0typeCOUNT_TIME=on&sev1typeCOUNT_TIME=on&sev2typeCOUNT_TIME=on&sev0typeHTTP_CLIENT=on&sev1typeHTTP_CLIENT=on&sev2typeHTTP_CLIENT=on&sev0typeHTTP_SERVER=on&sev1typeHTTP_SERVER=on&sev2typeHTTP_SERVER=on&sev0typeINGEST=on&sev1typeINGEST=on&sev2typeINGEST=on&sev0typeLIVELIHOOD=on&sev1typeLIVELIHOOD=on&sev2typeLIVELIHOOD=on&sev0typeLOGGING=on&sev1typeLOGGING=on&sev2typeLOGGING=on&sev0typeMEMORY=on&sev1typeMEMORY=on&sev2typeMEMORY=on&sev0typeMETADATA=on&sev1typeMETADATA=on&sev2typeMETADATA=on&sev0typeONLINE_TIM=on&sev1typeONLINE_TIM=on&sev2typeONLINE_TIM=on&sev2typePVFS=on&sev0typePVFS-BITRAT=on&sev1typePVFS-BITRAT=on&sev2typePVFS-BITRAT=on&sev0typePVFS-CACHE=on&sev1typePVFS-CACHE=on&sev2typePVFS-CACHE=on&sev0typePVFS-CDN=on&sev1typePVFS-CDN=on&sev2typePVFS-CDN=on&sev0typePVFS-JOB=on&sev1typePVFS-JOB=on&sev2typePVFS-JOB=on&sev0typePVFS-MNG=on&sev1typePVFS-MNG=on&sev2typePVFS-MNG=on&sev0typePVFS-RAID=on&sev1typePVFS-RAID=on&sev2typePVFS-RAID=on&sev0typeRTSP=on&sev1typeRTSP=on&sev2typeRTSP=on&sev0typeRTSP_SERVER=on&sev1typeRTSP_SERVER=on&sev2typeRTSP_SERVER=on&sev0typeSERIALIZE=on&sev1typeSERIALIZE=on&sev2typeSERIALIZE=on&sev0typeSOCK_POOL=on&sev1typeSOCK_POOL=on&sev2typeSOCK_POOL=on&sev0typeSTATMUX=on&sev1typeSTATMUX=on&sev2typeSTATMUX=on&sev0typeSTREAMER=on&sev1typeSTREAMER=on&sev2typeSTREAMER=on&sev3typeSTREAMER=on&sev4typeSTREAMER=on&sev0typeSTREAMER_IO=on&sev1typeSTREAMER_IO=on&sev2typeSTREAMER_IO=on&sev0typeSTREAM_ERR=on&sev1typeSTREAM_ERR=on&sev2typeSTREAM_ERR=on&sev3typeSTREAM_ERR=on&sev4typeSTREAM_ERR=on&sev0typeSTREAM_PTS=on&sev1typeSTREAM_PTS=on&sev2typeSTREAM_PTS=on&sev0typeSYS_OPER=on&sev1typeSYS_OPER=on&sev2typeSYS_OPER=on&sev3typeSYS_OPER=on&sev4typeSYS_OPER=on&sev0typeUSER_OPER=on&sev1typeUSER_OPER=on&sev2typeUSER_OPER=on&sev3typeUSER_OPER=on&sev4typeUSER_OPER=on&contextinhidden=&contextouthidden=&Update=Update" 192.168.5.117:5555

But that gives me the error "Could not find handler for URL /"

Anyone have any advise?

---------- Post updated at 03:34 AM ---------- Previous update was at 03:17 AM ----------

Never mind. Me and my coworker figured it out using wget --post-data
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Web Development

CURL - Post Form Isssue ( sequel )

Hi, I write a new thread to discuss about my closed topic with new information ( /280990-curl-post-form-issue.html ) The previous post was closed because of missing informations, I didn't have access yet to server logs. ----------------------------------------------------------------------... (4 Replies)
Discussion started by: Fred13
4 Replies

2. Web Development

Curl - post form issue

I'm having an issue with curl post form, I dont' understand what I'm mising. I would like to send a post command login/password to a form, quite simple in the paper. URL : http: // <myebsite> / login Here the form source code : <form action="/login_check" method="post"> <input... (3 Replies)
Discussion started by: Fred13
3 Replies

3. UNIX for Beginners Questions & Answers

How to use cURL to download web page with authentification (form)?

Hello, I'm new in the forum and really beginer, and also sorry form my bad english. I use linux and want to create little program to download automaticaly some pdf (invoices) and put in a folder of my computer. I learn how to do and programme with ubuntu but the program will be implemented... (1 Reply)
Discussion started by: MarcelOrMittal
1 Replies

4. UNIX for Advanced & Expert Users

Python: Value Not Posting To Form

I know I'm missing something easy here, but this has been racking my brain. I have a python script I've been trying to use to post to a form. I see the post goes through as I get data back from the page after the post. Only problem is I receive an error the data is not being passed: $ ./script >>... (0 Replies)
Discussion started by: Azrael
0 Replies

5. Shell Programming and Scripting

Curl Script - Post a file (multipart/form-data)

Hi All, I am trying to post an xml file (utf-16 encoded) using curl to a REST service. The REST service is expecting 'multipart/form-data' content type. curl -k -i -H "Content-Type=multipart/form-data" -F "filename=@file.xml;type=text/xml" -X POST -u <username>:<password> <endPointURL> ... (0 Replies)
Discussion started by: Anooja G
0 Replies

6. Shell Programming and Scripting

Transpose Data form Different form

HI Guys, I have data in File A.txt RL03 RL03_A_1 RL03_B_1 RL03_C_1 RL03 -119.8 -119.5 -119.5 RL07 RL07_A_1 RL07_B_1 RL07_C_1 RL07 -119.3 -119.5 -119.5 RL15 RL15_A_1 RL15_C_1 RL15 -120.5 -119.4 RL16... (2 Replies)
Discussion started by: asavaliya
2 Replies

7. Shell Programming and Scripting

Using cURL to submit a post form

I am trying to write a shell script to use curl in order to automate downloading data from a website. The URL with the post form is here: http://try-db.org/de/InfoBySpecies.php . I have a list of about 1800 different species I want to check. For Example, choose the first species and use the... (2 Replies)
Discussion started by: hansvg
2 Replies

8. Red Hat

Posting Multiple Files using cURL

Hi, I am currently in the process of creating a script that will use cURL to HTTP POST the contents of a file on the server. I am able to run the command; curl -d @/path/to/file/filename.dat "https://posting.server.com/test.aspx"to post a single file and this works as expected. The... (4 Replies)
Discussion started by: MarkPaxo
4 Replies

9. Programming

libcurl - how to do GET form posting in C?

Hi, I'm learning libcurl so that I can use it in my GTK+/C program and went through the tutorial and code samples but it has only mentioned about POST form as the site I'm using has the GET form and only thing I found googling was using the command in xterm which I don't want. I would be very... (1 Reply)
Discussion started by: jaeezzy
1 Replies

10. Shell Programming and Scripting

maintaining form post session using curl

Hello, I have searched for a good part of the day, but cannot seem to find an answer to this. I hope this is an appropriate forum for my question. I am wanting to download a blog web page using a script. It requires username and password login. I have tried the following (an example) to no... (1 Reply)
Discussion started by: Allasso
1 Replies
Login or Register to Ask a Question