How to send HTTP POST query string consist of & and NULL character
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: How to send HTTP POST query string consist of & and NULL character

  1. #1
    Join Date
    Dec 2006
    Posts
    37

    How to send HTTP POST query string consist of & and NULL character

    Hi All,

    I want to send HTTP POST message to my web server method. But my query string consist of '&' and NULL.

    I am using wininet classes method such as,

    HttpSendRequest();

    My query string for the POST request is mentioned below.

    POST /Service/Service.asmx/CheckValidity HTTP/1.1
    Host: localhost
    Content-Type: application/x-www-form-urlencoded
    Content-Length: length

    Test1=<data including '&' and NULL>

    Body part like this "Ab1Cde4&adjdkNULLdfa!#A

    When I send this request to web server, web server does not get the same string rather the string gets truncated.

    I am testing this with a web server build locally using ASP.NET

    Please help me how I can solve this

    Thanks,
    Bidesh

  2. #2
    Join Date
    Jun 2002
    Location
    Sweden
    Posts
    467

    Re: How to send HTTP POST query string consist of & and NULL character

    since you have specified that the string is url encoded, you need to make sure that it is.

    & should be sent as &amp; and you can send null as %00. All spaces should be replaced with a plus sign: +

    Your example string should look like:
    %22Ab1Cde4%26adjdk%00dfa!%23A
    "The making of software, like the making of sausages, should never be watched."

    http://blog.gauffin.org - .NET Coding/Architecture

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center