HttpWebRequest

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

    HttpWebRequest

    Hello to all,
    I'm trying to send an http command. The supplier of the service I have to
    use said me that I have not to send the URI string encoded, it means,
    special characters have not to be sent encoded, for example, " has NOT TO be
    send as %22, space has NOT TO be send as %20, Û has NOT TO BE send as
    %C3%9B.
    How can I do that?. For the request I use the following:

    Dim req As Net.HttpWebRequ est =
    CType(Net.WebRe quest.Create(re questUriString) , Net.HttpWebRequ est)

    Dim response As Net.HttpWebResp onse =
    CType(req.GetRe sponse(), Net.HttpWebResp onse)

    and I can see that req.Address.Abs oluteUri is always encoded.

    Thanks for help!



  • =?Utf-8?B?YnJ1Y2UgYmFya2Vy?=

    #2
    RE: HttpWebRequest

    instead of passing a string to the webrequest, pass a Uri: new
    Uri(url,"",true ), to create the uri with escape turned off.

    -- bruce (sqlwork.com)


    "Rob" wrote:
    Hello to all,
    I'm trying to send an http command. The supplier of the service I have to
    use said me that I have not to send the URI string encoded, it means,
    special characters have not to be sent encoded, for example, " has NOT TO be
    send as %22, space has NOT TO be send as %20, Û has NOT TO BE send as
    %C3%9B.
    How can I do that?. For the request I use the following:
    >
    Dim req As Net.HttpWebRequ est =
    CType(Net.WebRe quest.Create(re questUriString) , Net.HttpWebRequ est)
    >
    Dim response As Net.HttpWebResp onse =
    CType(req.GetRe sponse(), Net.HttpWebResp onse)
    >
    and I can see that req.Address.Abs oluteUri is always encoded.
    >
    Thanks for help!
    >
    >
    >
    >

    Comment

    Working...