Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   Issuing an http request via c (http://www.go4expert.com/forums/issuing-http-request-via-c-t1566/)

yudazdk 7Oct2006 18:59

Issuing an http request via c

OS: RedHat Linux

I have to write a c program that should issue an HTTP GET request such as the following:

http://foobar.com/Processbounce.php?remove=1 (The script updates a row
in the database table)

I tried using socket for that on port 80.
I used functions:
1) sockfd = socket(PF_INET, SOCK_STREAM, 0)
2) connect(sockfd, (struct sockaddr *)&dest_addr, sizeof(struct
sizeof(struct sockaddr))
3) bytes_sent = send(sockfd, msg, len, 0) ; // msg contains the http
headers get request

The problem is that the script doesn't work. I tried many variations
of http header get request with no success.


shabbir 9Oct2006 07:01

Re: Issuing an http request via c
Can you share the exact code that is not working.

All times are GMT +5.5. The time now is 03:42.