I have a simple server and client application. Client side uses
HTTP::request_get to contact server file "sum.rb", which takes
parameter a and b, return the sum a+b. Client side code is as:
1. How sever side parse the parameter a and b (in php, we can use
a=_GET['a']; b= _GET['b'] to retrieve content
2. How server side response to client (in php, we can use echo a+b;)?
But It seems that my response.body is always the sum.rb code instead
of the actual sum.
However, for my case, I still need to parse the parameter in the URL,
i.e. in http://www.mysite.com/sum.rb?a=3&b=5, how can server knows
a=3, b=5?
Thanks a lot
Lauren
···
On Mar 13, 9:50 am, Lauren <lun.zhe...@gmail.com> wrote:
I have a simple server and client application. Client side uses
HTTP::request_get to contact server file "sum.rb", which takes
parameter a and b, return the sum a+b. Client side code is as:
1. How sever side parse the parameter a and b (in php, we can use
a=_GET['a']; b= _GET['b'] to retrieve content
2. How server side response to client (in php, we can use echo a+b;)?
But It seems that my response.body is always the sum.rb code instead
of the actual sum.
However, I still cannot figure out how to parse the parameter on the
several side. That is, when client sends a http get request to http://www.mysite.com/sum.rb?a=3&b=5, how can server (sum.rb) parses
the parameter and knows a=3, b=5.
Thanks a lot,
Lauren
···
On Mar 13, 9:50 am, Lauren <lun.zhe...@gmail.com> wrote:
I have a simple server and client application. Client side uses
HTTP::request_get to contact server file "sum.rb", which takes
parameter a and b, return the sum a+b. Client side code is as:
1. How sever side parse the parameter a and b (in php, we can use
a=_GET['a']; b= _GET['b'] to retrieve content
2. How server side response to client (in php, we can use echo a+b;)?
But It seems that my response.body is always the sum.rb code instead
of the actual sum.
However, I still cannot figure out how to parse the parameter on the
several side. That is, when client sends a http get request to http://www.mysite.com/sum.rb?a=3&b=5, how can server (sum.rb) parses
the parameter and knows a=3, b=5.
On Mar 13, 4:36 pm, Jim Clark <diegosl...@gmail.com> wrote:
Lauren wrote:
> However, I still cannot figure out how to parse the parameter on the
> several side. That is, when client sends a http get request to
>http://www.mysite.com/sum.rb?a=3&b=5, how can server (sum.rb) parses
> the parameter and knows a=3, b=5.