Http request in Linux

Hi,

i need a guide how to write a script which i can do a http request. Let say the request look like below;

http://www.test.com?txid=1&type=service&server=linux

I have a list of "txid" (in *.txt) and need to run all "txid" acordingly. So that mean, every transaction i have to refer "txid" file.

Hope anybody can help me. Thanks in advance.

-malaysoul-

Check out "wget"

then how i can run the script if i want to change value of "txid" automatically?

Is this what you want?

[bernardchan@bernardchan tmp]$ LANG=C . /dev/shm/x.sh
--12:34:13--  http://www.jpkxl.com/?txid=1&type=service&server=linux
           => `index.html?txid=1&type=service&server=linux'
Resolving www.jpkxl.com... failed: Name or service not known.
--12:34:13--  http://www.jpkxl.com/?txid=2&type=service&server=linux
           => `index.html?txid=2&type=service&server=linux'
Resolving www.jpkxl.com... failed: Name or service not known.
[bernardchan@bernardchan tmp]$ cat /dev/shm/x.sh
function call_wget {
        wget "http://www.jpkxl.com/?txid=$1&type=service&server=linux"
}
call_wget 1;
call_wget 2;

You can use "CURL" to make http request. There are various options to simulate the navigation of URLs.

yes..but if list of txid in a file, i.e txidlst.txt, how i can coding it? Appreciated you help.

Sorry i'm beginner in unix.

I don't understand the question. Could you rephrase it please?

you can use loops. For eg say in your txid file, you have something like this

1
2
3
4
5

then using read and while loop

while read txid 
do
   url="http://www.test.com?txid="$txid"&type=service&server=linux"
   wget url
done < txid.txt

something like this. the code is just an example and not tested.