Spaces being removed from POST data

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Terry Olsen

    #1

    Spaces being removed from POST data

    Using the HttpWebRequest to post data for a query, the input tag that
    i'm mimicking is:

    <input type "hidden" name="severity" value="'SEV 2', 'SEV 5'">

    I'm using this for making the query via HttpWebRequest POST method:

    .... & _
    "&severity= 'SEV 2', 'SEV 5'" & _
    .... & _

    This returns an empty result set. Looking at the html that was returned,
    I see this:

    <input type="hidden" name="severity" value="'SEV2',' SEV5'">

    Why is it removing the spaces in my 'SEV 2', 'SEV 5' items?

    I've tried using &nbsp; instead of the spaces, but that causes a server
    error.

    If I remove the severity property from the POST data, I get all the
    records returned.

    Can anyone shed some light on this?

    Thanks.

    *** Sent via Developersdex http://www.developersdex.com ***
  • Michel Posseth  [MCP]

    #2
    Re: Spaces being removed from POST data


    Terry

    You are probably not posting to the website but concate a request string

    example : -)



    a space is represented by %20 so this should solve your problem

    However easier would be to perform a urlencode on the complete string , a
    receiving webserver wil automaticly decode the string ( no extra code is
    necesary )


    regards

    Michel


    "Terry Olsen" <tolsen64@hotma il.comschreef in bericht
    news:uW4uiiNNHH A.420@TK2MSFTNG P06.phx.gbl...
    Using the HttpWebRequest to post data for a query, the input tag that
    i'm mimicking is:
    >
    <input type "hidden" name="severity" value="'SEV 2', 'SEV 5'">
    >
    I'm using this for making the query via HttpWebRequest POST method:
    >
    ... & _
    "&severity= 'SEV 2', 'SEV 5'" & _
    ... & _
    >
    This returns an empty result set. Looking at the html that was returned,
    I see this:
    >
    <input type="hidden" name="severity" value="'SEV2',' SEV5'">
    >
    Why is it removing the spaces in my 'SEV 2', 'SEV 5' items?
    >
    I've tried using &nbsp; instead of the spaces, but that causes a server
    error.
    >
    If I remove the severity property from the POST data, I get all the
    records returned.
    >
    Can anyone shed some light on this?
    >
    Thanks.
    >
    *** Sent via Developersdex http://www.developersdex.com ***

    Comment

    Working...