Loading ...
Sorry, an error occurred while loading the content.

Re: [soaplite] POST & Host lines in http request

Expand Messages
  • Lev Lvovsky
    Replying to my own post here, perhaps this is a developer question (not sure if the developer of SOAP::Lite is on this list): It seems that according to this
    Message 1 of 3 , Nov 1, 2007
    • 0 Attachment
      Replying to my own post here, perhaps this is a developer question
      (not sure if the developer of SOAP::Lite is on this list):

      It seems that according to this w3.org link: http://www.w3.org/
      Protocols/rfc2616/rfc2616-sec14.html

      the 'Host:' header is a requirement of HTTP 1.1. I see that the
      SOAP::Lite module is hardcoding version '1.1' in the HTTP request,
      however is not setting the 'Host:' header. Additionally, the "POST"
      part of the request contains the whole URL which should be split up
      between these two header fields.

      Any comments, input, etc?

      thanks!
      -lev


      On Oct 25, 2007, at 4:37 PM, Lev Lvovsky wrote:

      > Is there any way to split up the http request created by the
      > SOAP::Lite package so that instead of an http header like this:
      >
      > POST https://foo.com/bar1/bar2.extension HTTP/1.1
      >
      > we get something like:
      >
      > POST: /bar1/bar2.extension HTTP/1.1
      > Host: foo.com
      >
      > The server which I'm now submitting our SOAP query to doesn't like
      > the first format anymore, and insists on the second.
      >
      > Thanks!
      > -lev
      >
    • Dave Howorth
      ... I m not an expert on HTTP but nobody else has answered so here s my 2p worth ... FWIW, my reading of the spec agrees with you and your server
      Message 2 of 3 , Nov 2, 2007
      • 0 Attachment
        Lev Lvovsky wrote:
        > Replying to my own post here, perhaps this is a developer question
        > (not sure if the developer of SOAP::Lite is on this list):
        >
        > It seems that according to this w3.org link: http://www.w3.org/
        > Protocols/rfc2616/rfc2616-sec14.html
        >
        > the 'Host:' header is a requirement of HTTP 1.1. I see that the
        > SOAP::Lite module is hardcoding version '1.1' in the HTTP request,
        > however is not setting the 'Host:' header. Additionally, the "POST"
        > part of the request contains the whole URL which should be split up
        > between these two header fields.
        >
        > Any comments, input, etc?

        > On Oct 25, 2007, at 4:37 PM, Lev Lvovsky wrote:
        >
        >> Is there any way to split up the http request created by the
        >> SOAP::Lite package so that instead of an http header like this:
        >>
        >> POST https://foo.com/bar1/bar2.extension HTTP/1.1
        >>
        >> we get something like:
        >>
        >> POST: /bar1/bar2.extension HTTP/1.1
        >> Host: foo.com
        >>
        >> The server which I'm now submitting our SOAP query to doesn't like
        >> the first format anymore, and insists on the second.

        I'm not an expert on HTTP but nobody else has answered so here's my 2p
        worth ...

        FWIW, my reading of the spec agrees with you and your server
        implementation: "A client MUST include a Host header field in all
        HTTP/1.1 request messages". But as I say, I'm no expert.

        So if we accept for a moment that there's a problem, the next question
        is whose problem? SOAP::Transport::HTTP uses LWP's HTTP::Request and
        HTTP::Headers packages, so is it driving them incorrectly or are they
        broken? Looking at their POD, I see examples that don't have Host
        headers and I don't see any examples that do!

        So it may be worth rephrasing your question and asking it on the
        <libwww@...> mailing list.

        Cheers, Dave
      Your message has been successfully submitted and would be delivered to recipients shortly.