Basic cURL help!


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Basic cURL help!
# 1  
Old 06-24-2011
Java Basic cURL help!

hi!! this is my first post!! our university student search has this form which uses POST method(the website is swd.bits-goa.ac.in/searchform1)..now i tried sending post data from cURL...


curl -o this.html --data "name=rohan&id=&hostel=&room=&branch=&search=Search" swd.bits-goa.ac.in/searchform1

now when i open the output file..the results aren't in there...whats the problem???

(i am new so i am not suppposed to post url's..but even this is the same)
# 2  
Old 06-24-2011
Try a full URL?

Try tracing using strace/truss/tusc to see where it goes and what it sends.
# 3  
Old 06-24-2011
Absolutely no output, or incorrect output? Seeing the FORM would help. Sometimes there are hidden fields which need to be sent. Do you know how to telnet to a web server? Smilie

Firefox has a great add-on called Tamper Data, where you can view and edit POST variables. https://addons.mozilla.org/en-us/fir...n/tamper-data/

This way you can first see how your web browser really sends it, then you can see if the server responds if you change User-Agent, Referrer, etc.
# 4  
Old 06-24-2011
@neutronscott:i have tried tamper-data and the post data is the same as the the thing i tried!!! thanks for the reply Smilie
@DGPickett:i tried the full url..the only reason i didnt write it here is since i am a new to the forums,m not supposed to type in url's here Smilie...but ya !! will try the method you suggested..thanks for the reply!! Smilie
# 5  
Old 06-24-2011
scott had a point about services wanting a correct referrer, cookie or other http artifact. If you did not write it, are you sure it does not have other requirements, like utf-8 or accepts jpeg or . . . .
# 6  
Old 06-24-2011
also neutronscott-->no output!! i checked the code and there are no hidden fields!! i am relatively new to linux and don't quite know telnet!!! maybe the page is looking for a referrer like you said!!! thanx!! Smilie

---------- Post updated at 12:58 AM ---------- Previous update was at 12:56 AM ----------

@DGpickeet: that may very well be the reason!! thanks i tried cURL(m learning it so..) on an other wesite and it worked great!! thanks both of you!!!
# 7  
Old 06-24-2011
Telnet is just a kb to tcp socket and socket to screen tool, so you can use it on any socket except ssh. For instance, try this to simulate a browser accessing http://www.ibm.com/ with telnet:
Code:
$ (
echo 'GET / HTTP/1.0
 
 
 
'
sleep 5
) | telnet www.ibm.com 80

This User Gave Thanks to DGPickett For This Post:
 
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. SCO

Curl error

Hello I want to use the Curl and gives me this error. Can someone help me out # curl http : // www .google . es dynamic linker: curl: binder error: symbol not... (3 Replies)
Discussion started by: fersys
3 Replies

2. Shell Programming and Scripting

Using CURL in a script

Hi all so I'm new to scripting but I am making a script that is a url shortener. It will take a url off the command line and spit back the shortened version using bit.ly's api this is what I have so far if then echo "You must supply a URL." exit 1 fi read url... (3 Replies)
Discussion started by: subway69
3 Replies

3. Shell Programming and Scripting

Help with cURL

Hi all; first of all i need to clarify that i am new to apache2 server configuration and for some needs i want to transfer some files using curl to web directory,so please bear with me: following is the command i m running to transfer file to my web directory: curl -T "q"... (4 Replies)
Discussion started by: arien001
4 Replies

4. Programming

cURL and cgi

I have a CGI application done in c++ that communicates with PayPal. I've had an issue where the application dies when I try to perform a cURL operation. Upon further inspection it seems that I can run cURL examples from the command line. Upon even further inspection it seems that I can run... (8 Replies)
Discussion started by: tatebn
8 Replies

5. Shell Programming and Scripting

Curl command

Hello, I try to take out of the command curl the info of the time... time curl --write \"Downloaded %{time total}\" -o ...... but having some problem. (1 Reply)
Discussion started by: protocomm
1 Replies

6. Shell Programming and Scripting

use of curl

I have to transfer a file from my aix box to another server using ftps protocol, how can i achieve this using curl preferably or any other utility. Regards Sandeep (0 Replies)
Discussion started by: jayawantsandeep
0 Replies

7. AIX

use of curl

Hi guys , need some help I have to transfer a file from my aix box to another server using ftps protocol, how can i achieve this using curl preferably or any other utility. Thanks Sandeep (0 Replies)
Discussion started by: jayawantsandeep
0 Replies

8. Shell Programming and Scripting

curl

Aren't there any way to download files as below? For example, I want to download all .html files under the root directory of unix.com/ curl -O https://www.unix.com/*.html This won't work, but please tell me the way to do this. Well, the best way is to get the file list of the directory, but i... (6 Replies)
Discussion started by: Euler04
6 Replies
Login or Register to Ask a Question