Re: Send XML request to a server with telnet. - TCP-IP

This is a discussion on Re: Send XML request to a server with telnet. - TCP-IP ; slebetman@yahoo.com a écrit : > Nanar Duff wrote: > > > This is also correct since HTTP 1.0 does not have any required headers. > > > > > Typically you'd need to do a POST request with the XML ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: Re: Send XML request to a server with telnet.

  1. Re: Send XML request to a server with telnet.

    slebetman@yahoo.com a écrit :
    > Nanar Duff wrote:
    >
    >
    > This is also correct since HTTP 1.0 does not have any required headers.
    >
    >
    >
    >
    > Typically you'd need to do a POST request with the XML document/code as
    > part of the message body sent to the server:
    >
    > POST /wher/I/want/to/send/my/data/ HTTP/1.0\r\n
    > Content-Length: 46\r\n
    > \r\n
    > to server
    >


    (sorry for the late, but server was down).

    Thanks for your answer, I try it by doing this:

    *************************************************
    $ telnet 8080
    POST /wher/I/want/to/send/my/data/ HTTP/1.1\r\n
    Content-Type: text/xml; charset=utf-8\r\n
    SOAPAction: ""\r\n
    Content-Length: 785\r\n
    Expect: 100-continue\r\n
    Host: :8080\r\n
    \r\n
    to server

    HTTP/1.1 400 Bad Request
    Server: Apache-Coyote/1.1
    Date: Sat, 06 May 2006 07:25:32 GMT
    Connection: close

    Connection closed by foreign host.
    $
    ************************************************** *


    But I' m not sure of the value of Content-Length. Is this the number of
    character in the XML request ?

    And maybe that my XML request is wrong. But server shouldn't send me
    "data" to warn me that my request was wrong ?




    Thanks.

  2. Re: Send XML request to a server with telnet.

    Nanar Duff a écrit :
    > Thanks for your answer, I try it by doing this:
    >
    > *************************************************
    > $ telnet 8080
    > POST /wher/I/want/to/send/my/data/ HTTP/1.1\r\n
    > Content-Type: text/xml; charset=utf-8\r\n
    > SOAPAction: ""\r\n
    > Content-Length: 785\r\n
    > Expect: 100-continue\r\n
    > Host: :8080\r\n
    > \r\n
    > to server
    >
    > HTTP/1.1 400 Bad Request
    > Server: Apache-Coyote/1.1
    > Date: Sat, 06 May 2006 07:25:32 GMT
    > Connection: close
    >
    > Connection closed by foreign host.
    > $
    > ************************************************** *
    >
    >
    > But I' m not sure of the value of Content-Length. Is this the number of
    > character in the XML request ?
    >
    > And maybe that my XML request is wrong. But server shouldn't send me
    > "data" to warn me that my request was wrong ?


    >
    > Thanks.



    Oops, I try request without \r\n, and its works fine.

    Thanks.

  3. Re: Send XML request to a server with telnet.


    Nanar Duff wrote:
    > Nanar Duff a écrit :
    > > Thanks for your answer, I try it by doing this:
    > >
    > > *************************************************
    > > $ telnet 8080
    > > POST /wher/I/want/to/send/my/data/ HTTP/1.1\r\n
    > > Content-Type: text/xml; charset=utf-8\r\n
    > > SOAPAction: ""\r\n
    > > Content-Length: 785\r\n
    > > Expect: 100-continue\r\n
    > > Host: :8080\r\n
    > > \r\n
    > > to server
    > >
    > > HTTP/1.1 400 Bad Request
    > > Server: Apache-Coyote/1.1
    > > Date: Sat, 06 May 2006 07:25:32 GMT
    > > Connection: close
    > >
    > > Connection closed by foreign host.
    > > $
    > > ************************************************** *
    > >
    > >
    > > But I' m not sure of the value of Content-Length. Is this the number of
    > > character in the XML request ?
    > >
    > > And maybe that my XML request is wrong. But server shouldn't send me
    > > "data" to warn me that my request was wrong ?

    >
    > >
    > > Thanks.

    >
    >
    > Oops, I try request without \r\n, and its works fine.
    >


    Yes, \r in my post refers to Carrige Return and \n refers to Linefeeds
    as per C convention. For \r\n configure your telnet client to have CRLF
    line endings (LF works but is not really conformant to HTTP spec) and
    press the Enter key (actually the Return key which is labelled Enter on
    most PC keyboard. The "real" Enter key is actually the one on the
    numeric keypad).


  4. Re: Send XML request to a server with telnet.

    slebetman@yahoo.com a écrit :
    > Yes, \r in my post refers to Carrige Return and \n refers to Linefeeds
    > as per C convention. For \r\n configure your telnet client to have CRLF
    > line endings (LF works but is not really conformant to HTTP spec)



    Ok, thanx for all this info


    > press the Enter key (actually the Return key which is labelled Enter on
    > most PC keyboard. The "real" Enter key is actually the one on the
    > numeric keypad).


    Ah ? But heuh... what is the difference between the Return key and the
    "real" Enter key ? (just for my "general knowledge" )

  5. Re: Send XML request to a server with telnet.

    In article <445f0a78$0$1490$626a54ce@news.free.fr>,
    Nanar Duff <_SPAMORAMA_dnanar@gmail.com> wrote:

    > slebetman@yahoo.com a écrit :
    > > Yes, \r in my post refers to Carrige Return and \n refers to Linefeeds
    > > as per C convention. For \r\n configure your telnet client to have CRLF
    > > line endings (LF works but is not really conformant to HTTP spec)

    >
    >
    > Ok, thanx for all this info
    >
    >
    > > press the Enter key (actually the Return key which is labelled Enter on
    > > most PC keyboard. The "real" Enter key is actually the one on the
    > > numeric keypad).

    >
    > Ah ? But heuh... what is the difference between the Return key and the
    > "real" Enter key ? (just for my "general knowledge" )


    For most applications, there's no difference.

    --
    Barry Margolin, barmar@alum.mit.edu
    Arlington, MA
    *** PLEASE post questions in newsgroups, not directly to me ***
    *** PLEASE don't copy me on replies, I'll read them in the group ***

+ Reply to Thread