I am trying to communicate with a server that is ready to accept HTTP GET requests and send back data per the request. However, I have very little experience in socket programming and I don't really know how to debug this. Googling on the web hasn't yielded much, except people saying I need to read the HTTP 1.1 spec which is the last thing I want to do.
I seem to be able to create, bind the socket and then send a GET request and that seems ok too but I am not able to receive anything.
The following are the relevant parts of the code:
Connection established:
Sending request:
The above works fine, but then below the receiving fails, in the first if-statement:
Can anyone share some insight as to how I can re-write the receiving code to get the data that is supposed to be returned to be based on the GET request? What is wrong here?
Hi everybody,
I have a *.vbs file which I want to run automatically. I want to know if there is anyway to implement the given example
for e.g "http://255.255.255.55/script.vbs"
what I mean is does anyone know how to make an http request from a unix script??
Thanks in advance!!!!!!!!!!! (1 Reply)
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"... (7 Replies)
Hi,
Maybe it's a stupid question, anyway here goes..
I have an Apache web server on Solaris box, let's say A, with a public ip
and a web application on a Linux box, uhmmm B, on a private lan with a private ip.
I want the people from outside to connect to the app, but its inside the lan,... (4 Replies)
Ok. I'm testing a new program component that is supposed to speed up our pipeline on the server. What it does is take in HEAD requests and shuffle them off to a different pipeline that is specially designed to handle HEAD requests quickly. The functionality works but now comes the question: how... (3 Replies)
Hi all,
Im trying to make an http get request to a web service from a linux machine like below and i get ERROR 500
wget http://10.1.21.236:8585/pns.asmx/Sen...&msgBody=werty
25018
$ --19:06:32-- http://10.1.21.236:8585/pns.asmx/Sen...erName=serverA
Connecting to 10.1.21.236:8585...... (1 Reply)
Hello,
I am using apache 2.2 and I need to have certain http requests (those including example.com for instance) to be executed normally and forwarded to another server.
With mod_rewrite, I could easily forward but then the input request would not be executed on my server. Right?
Am I... (1 Reply)
I am running a website but I still have problems with the "service temporarily unavailable error". I want to make a simple check if the website is up and running. Does anybody has an idea how to do it? (the site is password protected, so you have to add a user and pwd before logging in).
... (2 Replies)
Hi,
I am trying to write a shell script to parse the post request data that it received to a xml file. Below is the post request data that script is receiving.
-----------------------------7dd2339190c8e
Content-Disposition: form-data; name="param1"
1... (2 Replies)
Discussion started by: jdp
2 Replies
LEARN ABOUT REDHAT
http::request
HTTP::Request(3) User Contributed Perl Documentation HTTP::Request(3)NAME
HTTP::Request - Class encapsulating HTTP Requests
SYNOPSIS
require HTTP::Request;
$request = HTTP::Request->new(GET => 'http://www.oslo.net/');
DESCRIPTION
"HTTP::Request" is a class encapsulating HTTP style requests, consisting of a request line, some headers, and some (potentially empty) con-
tent. Note that the LWP library also uses this HTTP style requests for non-HTTP protocols.
Instances of this class are usually passed to the "request()" method of an "LWP::UserAgent" object:
$ua = LWP::UserAgent->new;
$request = HTTP::Request->new(GET => 'http://www.oslo.net/');
$response = $ua->request($request);
"HTTP::Request" is a subclass of "HTTP::Message" and therefore inherits its methods. The inherited methods most often used are header(),
push_header(), remove_header(), and content(). See HTTP::Message for details.
The following additional methods are available:
$r = HTTP::Request->new($method, $uri)
$r = HTTP::Request->new($method, $uri, $header)
$r = HTTP::Request->new($method, $uri, $header, $content)
Constructs a new "HTTP::Request" object describing a request on the object $uri using method $method. The $uri argument can be either
a string, or a reference to a "URI" object. The optional $header argument should be a reference to an "HTTP::Headers" object. The
optional $content argument should be a string.
$r->method([$val])
$r->uri([$val])
These methods provide public access to the attributes containing respectively the method of the request and the URI object of the
request.
If an argument is given the attribute is given that as its new value. If no argument is given the value is not touched. In either case
the previous value is returned.
The method() method argument should be a string.
The uri() method accept both a reference to a URI object and a string as its argument. If a string is given, then it should be
parseable as an absolute URI.
$r->as_string()
Method returning a textual representation of the request. Mainly useful for debugging purposes. It takes no arguments.
SEE ALSO
HTTP::Headers, HTTP::Message, HTTP::Request::Common
COPYRIGHT
Copyright 1995-2001 Gisle Aas.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
libwww-perl-5.65 2001-11-15 HTTP::Request(3)