DotNet: I need help about HttpWebRequest

  • gniht / 102 / Wed, 24 Jun 2009 20:19:00 GMT / Comments (0)
  • Once i have tried to encode a data with some encoding and then I called ISAPI with these values.
    Then I had checked at the IIS' LogFiles, I found that those value were encoded again by urlencode(not sure) Thus, the url that appeared in logfile is some kind like "/xxx.aspx?item=%1C%C0&date="

    Is there anyway to disable this function? I would like to pass these value as the original values.
    Because the ISAPI, which cannot be modified, see these parameters as a string and read it as the ways they are.

    We can do nothing about the ISAPI.

    Thank you for your kindness.

    Encoding iso = Encoding.GetEncoding(874);
    Encoding unicode = Encoding.GetEncoding(1252);
    byte[] isoBytes = iso.GetBytes("??????");
    string temp = unicode.GetString(isoBytes);

    //Uri uri = new Uri(url, false);
    //Response.Write(uri.ToString() + "
    ");

    StringBuilder stringBuilder = new StringBuilder(ConfigurationManager.AppSettings["isapi"].ToString());

    stringBuilder.Append("cmd=SEARCH&TYPE=B&item=");
    stringBuilder.Append(temp);

    HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create(stringBuilder.ToString());
    HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse();
    Stream receiveStream = myHttpWebResponse.GetResponseStream();
    Encoding encode = System.Text.Encoding.GetEncoding(874);

    StreamReader readStream = new StreamReader(receiveStream, encode);
    Response.Write(readStream.ReadToEnd().ToString());
  • Keywords:

    httpwebrequest, dotnet, .net

  • http://dotnet.itags.org/dotnet-tech/317766/«« Last Thread - Next Thread »»