CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2006

    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,


    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


  2. #2
    Join Date
    Jun 2002

    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:
    "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

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.