Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

persistent HTTP connections

Status
Not open for further replies.

GrahamBright

Programmer
Oct 31, 2003
65
AT
Hi,

Using LWP::UserAgent, Http::Request and Http::Headers, how is it possible to submit a HTTP POST without closing the connection, but instead sending another request.

All by requests so far are terminated with Connection: close, but I need to keep the connection open submit 4-8 more POST requests only then close the connection.

Thanks in advance,

Graham.

I use

my $objUserAgent = LWP::UserAgent->new(keep-alive=>1);

my $objRequest = HTTP::Request->new("POST", ' $request);

message dump

POST /vas_soap HTTP/1.1
TE: deflate,gzip;q=0.3
Connection: TE, close
Authorization: Basic NDM2NjQ2ODEwMzcxOm1zbnRlc3Q=
Host: 10.236.136.18:10021
User-Agent: libContent-Length: 1966
Content-Type: multipart/related; boundary="soap-border"; type="text/xml"
SoapAction: ""
--soap-border
Content-Type: application/xml
Content-ID: <Test>
<?xml version="1.0"?>
<soap-env:Envelope xmlns:soap-env=" xmlns=" <soap-env:Header>
<TransactionID soap-env:mustUnderstand="1">TransID</TransactionID>
</soap-env:Header>
<soap-env:Body>
<SubmitReq>
<MM7Version>5.3.0</MM7Version>
<SenderIdentification>
<VASPID>436646810371</VASPID>
<VASID>News</VASID>
<SenderAddress>
<Number>436646810371</Number>
</SenderAddress>
</SenderIdentification>
<Recipients>
<To>
<Number>436642931696</Number>
</To>
</Recipients>
<LinkedID>mms00016666</LinkedID>
<MessageClass>Personal</MessageClass>
<DeliveryReport>False</DeliveryReport>
<ReadReply>False</ReadReply>
<Priority>Normal</Priority>
<Subject>SOAP TEST TOOL</Subject>
</SubmitReq>
</soap-env:Body>
</soap-env:Envelope>
--soap-border
Content-Type: multipart/mixed; boundary="boundary"
--boundary
Content-Type: text/plain; Name="tekst.txt"; Charset=ISO-8859-1
Content-id: <tekst.txt>
Content-location: tekst.txt
test
--boundary
Content-Type: image/gif;Name="h2bullet.gif"
Conten
[BfG
r0L@
t-id: <h2bullet.gif>
Content-location: h2bullet.gif
Content-Transfer-Encoding: base64
R0lGODdhEgAOAKUAAPj4+Pj8+PDs8Oi0wPCMsPDc6NAcWNAEUMgEQMAAQKgsUNiEmOhomNAESOgc
YOA0cLgAOLAAMJgAKOBciLgAQKAAOIgMMIAAIKAIOIAAKFAcKHgAIODI2ODM0KgIQHAAGOjY2AAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAEgAOAAAGfkCAcAgIGI8BolIo
GBAGg8JSSTAcEAnFYjpkNBwPBCQimXAJiAfhoaBULJfBUmBAOBwJTEWS0SiWA1gUEBgBGRcXGxaA
hBSFHBwbkotKHR57AZCQGx9/SgIKF4eIkhsaW0sEFx+JG4h+XAALq5IfflKxAwoWFgoEsUQgAgJc
QQA7
--boundary--
--soap-border--
(0N@
HTTP/1.1 200 OK
Date: Tue, 12 Apr 2005 10:10:20 GMT
Server: Apache/1.3.20 (Unix) mod_ssl/2.8.4 OpenSSL/0.9.6
Content-Type: text/plain
Content-Length: 551
Connection: close
<?xml version="1.0"?><SOAP-ENV:Envelope xmlns=" xmlns:SOAP-ENV=" SOAP-ENV:mustUnderstand="1">TransID</TransactionID></SOAP-ENV:Header><SOAP-ENV:Body><SubmitRsp><MM7Version>5.3.0</MM7Version><Status><StatusCode>1000</StatusCode><StatusText>Success</StatusText><Details>1000:OK</Details></Status><MessageID>13D44B6A-AB3B-71D9-8E0C-0002A5C67AF4</MessageID></SubmitRsp></SOAP-ENV:Body></SOAP-ENV:Envelope>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top