Hi There,
I have one question. In which language can i wrote the fastest "script/program", which can make GET and POST requests to lagged web site. I'm trying to GET / POST pages from/to lagged server. What is a best way to communicate with the lagged server? Make for example 10 parallel requests or make one request with some timeout or something else? In which language can i do this. I already wrote Shell script with CURL web client but the CURL lag all the time. Can you help me please with this issues.
Thanks a lot.
Best programming language to make web POST / GET requests
Started by eth4rendil, Dec 04 2009 02:43 AM
7 replies to this topic
#1
Posted 04 December 2009 - 02:43 AM
|
|
|
#2
Posted 04 December 2009 - 03:14 AM
I'd say PHP.
#3
Posted 04 December 2009 - 03:31 AM
so1i said:
I'd say PHP.
and what ist the best HTTP / HTTPS client in PHP to do this? I have already tried PHPWebHacks and PHPcurl...
#4
Posted 04 December 2009 - 07:24 AM
I would probably use curl multi if I were to do many fetches at a time...
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall
I study Information Systems at Karlstad University when I'm not on CodeCall
#5
Posted 04 December 2009 - 07:26 AM
Orjan said:
I would probably use curl multi if I were to do many fetches at a time...
Hi Orjan,
thank for your advice. Could you link me example code how to use "curl multi" to post or get?
#6
Posted 04 December 2009 - 07:56 AM
you use the curl_multi_init function to init it, and then add curl handles to this multi handle
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall
I study Information Systems at Karlstad University when I'm not on CodeCall
#7
Posted 04 December 2009 - 08:51 AM
i have found this fine example:
But i don't think that this work realy simultaneous.
I did one test:
fist i started this simple test shell script on my server. This script run 20 simultaneous requests:
in the apache log files were all requests in one second.
After i started the PHP code what i found.
Request in this case were in range 1-3 seconds.....
According this test i think that curl multi requests are not the best way to do this or is the php code what i foud wrong?
phpied.com/simultaneuos-http-requests-in-php-with-curl
But i don't think that this work realy simultaneous.
I did one test:
fist i started this simple test shell script on my server. This script run 20 simultaneous requests:
#!/bin/bash browser="Mozilla/5.0 (Windows; U; Windows NT 6.1; sk; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)" docasny=0 while (( $docasny < 20 )); do curl -Ls -A "$browser" testpage >>temp & ((docasny++)) done
in the apache log files were all requests in one second.
After i started the PHP code what i found.
Request in this case were in range 1-3 seconds.....
According this test i think that curl multi requests are not the best way to do this or is the php code what i foud wrong?
#8
Posted 04 December 2009 - 05:37 PM
Well, you can't do anything at simultaneous really, everything actually needs to be started one after another, but the thing is that it throws away x requests in a row, than awaits answer on all of them and when all results are in, it returns them all to you.
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall
I study Information Systems at Karlstad University when I'm not on CodeCall


Sign In
Create Account

Back to top









