LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-24-2007, 10:32 AM   #1
Balakrishnan84
Member
 
Registered: Feb 2007
Location: Bangalore, India
Distribution: Fedore Core 6
Posts: 41

Rep: Reputation: 15
HTTP REQUEST to Apache server from C program


Hello All,
I am not sure whether I can post this problem in this thread. Sorry if I am in wrong thread. Please redirect me to the correct thread.
My problem is, I have a server running Apache which contains a perl program to display xml file. I want to get this file using a c-program. Instead of using any text browser like lynx,elinks and so on, I want to know is there any library available for c to send a http request to that apache server and get the xml file.
Thanks in advance.
 
Old 07-24-2007, 12:27 PM   #2
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
i'm am not quite certain but you chould start by looking at the source of wget.

else the band-aid fix would be to
Code:
system("wget");
 
Old 07-24-2007, 11:37 PM   #3
Balakrishnan84
Member
 
Registered: Feb 2007
Location: Bangalore, India
Distribution: Fedore Core 6
Posts: 41

Original Poster
Rep: Reputation: 15
Thanks. Im currently looking into "wget" source code only. It supports more protocols....Im looking for another text browser which supports only HTTP. I dont want to use system command. Rather some API which does that...
Thanks.
 
Old 07-25-2007, 06:05 AM   #4
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
Hi

Maybe take a look at curl/libcurl.
http://curl.haxx.se/

I think it's in almost any distro though, so you can install it with yum or whatever.
 
Old 07-26-2007, 12:40 AM   #5
Balakrishnan84
Member
 
Registered: Feb 2007
Location: Bangalore, India
Distribution: Fedore Core 6
Posts: 41

Original Poster
Rep: Reputation: 15
Thanks for your valuable reply. I think libcurl will serve my purpose.
 
Old 07-26-2007, 02:30 AM   #6
haxpor
Member
 
Registered: Dec 2006
Distribution: Ubuntu 20.04
Posts: 87

Rep: Reputation: 15
There also another way to do this, but it's not simple as using libcurl.
It's socket programming, i dont know whether you want to to that or not.
The good reference is book of "Unix Network Programming", I think you can find example around there most easily.
 
Old 07-26-2007, 04:00 AM   #7
Balakrishnan84
Member
 
Registered: Feb 2007
Location: Bangalore, India
Distribution: Fedore Core 6
Posts: 41

Original Poster
Rep: Reputation: 15
Thanks for your idea. But I very much aware of this. I want a ready made library. This is just a part of by system. I have much more other than this libcurl. Thanks anyway.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache HTTP Server gjagadish Linux - Software 5 12-18-2006 02:39 PM
Apache HTTP Server gjagadish Programming 1 08-10-2006 09:10 AM
Apache HTTP Server gjagadish Linux - Software 2 02-09-2006 10:58 PM
apache: http redirect for any request going to www.foo.com/* psychobyte Linux - Software 1 04-11-2005 05:57 PM
Request for http.conf file for Apache 1.3.26 Thinkgeekness Linux - Software 2 04-19-2003 12:58 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration