EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

HTTP CLIENT and a web server

Started by Ty May 10, 2012
Hi,

I have a web server up and running but now I need to send HTTP REQUEST POST and response to it. Do I also need to setup a HTTP SERVER? Is there a difference between Rabbitweb and a HTTP CLIENT?

I need to RESPONSE to HTTP POST REQUEST with xml in its body. I would really appreciate your assistance. Thanks

Are you connecting the rabbit by LAN?

If so, its pretty straight forward.

You open the connection on port 80 (do you know how to open TCP/IP ports
on the rabbit?)

You then send something like this (without the double quotes):

"GET / HTTP/1.1\r\nHost:www.google.com\r\n\r\n"

The web server will then respond with its data, headers first, then the
web page HTML.

In the above, the "GET /" means get the root page of the site. If you
wanted to get a specific page and pass in arguments (GET args, not sure
how to pass in POST args), then you would do something like:

"GET /somefolder/somepage.php?arg1=test&arg2=test
HTTP/1.1\r\nHost:someserver.com\r\n\r\n"
To test this, on your PC you can open a command prompt, then type:

telnet google.com 80 + enter

The screen will go blank waiting for your input.

Type:
GET / HTTP/1.1 + enter
Host:www.google.com + enter + enter (yes, enter twice)

You will then see googles home page in a plain text format...

Hope this helps...

John Mc Murray
j...@softsmart.co.za
011 083 7085

SoftSmart.co.za / PHP-Web-Host.com
On 2012/05/10 16:06, Ty wrote:
>
> Hi,
>
> I have a web server up and running but now I need to send HTTP REQUEST
> POST and response to it. Do I also need to setup a HTTP SERVER? Is
> there a difference between Rabbitweb and a HTTP CLIENT?
>
> I need to RESPONSE to HTTP POST REQUEST with xml in its body. I would
> really appreciate your assistance. Thanks
Thanks John. I am connecting to the rabbit by LAN and WAN. Your information was very valuable. I was thinking about opening up a tcpip socket to send HTTP POST and wait for HTTP REQUEST POST from user. Does it matter if its a LAN or WAN connection? Thanks

--- In r..., John Mc Murray wrote:
>
> Are you connecting the rabbit by LAN?
>
> If so, its pretty straight forward.
>
> You open the connection on port 80 (do you know how to open TCP/IP ports
> on the rabbit?)
>
> You then send something like this (without the double quotes):
>
> "GET / HTTP/1.1\r\nHost:www.google.com\r\n\r\n"
>
> The web server will then respond with its data, headers first, then the
> web page HTML.
>
> In the above, the "GET /" means get the root page of the site. If you
> wanted to get a specific page and pass in arguments (GET args, not sure
> how to pass in POST args), then you would do something like:
>
> "GET /somefolder/somepage.php?arg1=test&arg2=test
> HTTP/1.1\r\nHost:someserver.com\r\n\r\n"
> To test this, on your PC you can open a command prompt, then type:
>
> telnet google.com 80 + enter
>
> The screen will go blank waiting for your input.
>
> Type:
> GET / HTTP/1.1 + enter
> Host:www.google.com + enter + enter (yes, enter twice)
>
> You will then see googles home page in a plain text format...
>
> Hope this helps...
>
> John Mc Murray
> john@...
> 011 083 7085
>
> SoftSmart.co.za / PHP-Web-Host.com
> On 2012/05/10 16:06, Ty wrote:
> >
> > Hi,
> >
> > I have a web server up and running but now I need to send HTTP REQUEST
> > POST and response to it. Do I also need to setup a HTTP SERVER? Is
> > there a difference between Rabbitweb and a HTTP CLIENT?
> >
> > I need to RESPONSE to HTTP POST REQUEST with xml in its body. I would
> > really appreciate your assistance. Thanks
> >
>
Hi Ty...

I really don't know much about networking, but it doesn't really matter
what the connection is as long as that connection can reach the web
server. I think you should just try it out and see. I usually start off
testing with google because if it doesn't work I'm pretty sure the
problem is on my end and not on Google's.

John Mc Murray
j...@softsmart.co.za
011 083 7085

SoftSmart.co.za / PHP-Web-Host.com
On 2012/05/10 18:10, Ty wrote:
>
> Thanks John. I am connecting to the rabbit by LAN and WAN. Your
> information was very valuable. I was thinking about opening up a tcpip
> socket to send HTTP POST and wait for HTTP REQUEST POST from user.
> Does it matter if its a LAN or WAN connection? Thanks
>
> --- In r...
> , John Mc Murray wrote:
> >
> > Are you connecting the rabbit by LAN?
> >
> > If so, its pretty straight forward.
> >
> > You open the connection on port 80 (do you know how to open TCP/IP
> ports
> > on the rabbit?)
> >
> > You then send something like this (without the double quotes):
> >
> > "GET / HTTP/1.1\r\nHost:www.google.com\r\n\r\n"
> >
> > The web server will then respond with its data, headers first, then the
> > web page HTML.
> >
> > In the above, the "GET /" means get the root page of the site. If you
> > wanted to get a specific page and pass in arguments (GET args, not sure
> > how to pass in POST args), then you would do something like:
> >
> > "GET /somefolder/somepage.php?arg1=test&arg2=test
> > HTTP/1.1\r\nHost:someserver.com\r\n\r\n"
> >
> >
> > To test this, on your PC you can open a command prompt, then type:
> >
> > telnet google.com 80 + enter
> >
> > The screen will go blank waiting for your input.
> >
> > Type:
> > GET / HTTP/1.1 + enter
> > Host:www.google.com + enter + enter (yes, enter twice)
> >
> > You will then see googles home page in a plain text format...
> >
> > Hope this helps...
> >
> > John Mc Murray
> > john@...
> > 011 083 7085
> >
> > SoftSmart.co.za / PHP-Web-Host.com
> >
> >
> > On 2012/05/10 16:06, Ty wrote:
> > >
> > > Hi,
> > >
> > > I have a web server up and running but now I need to send HTTP
> REQUEST
> > > POST and response to it. Do I also need to setup a HTTP SERVER? Is
> > > there a difference between Rabbitweb and a HTTP CLIENT?
> > >
> > > I need to RESPONSE to HTTP POST REQUEST with xml in its body. I would
> > > really appreciate your assistance. Thanks
> > >
> > >
> >

The 2024 Embedded Online Conference