none
pass QueryString on Web. RRS feed

  • Question

  • hi

    If I need to send Post Query On Web how can i achieve this task.?

    I have one Query string .

    https://secure.f-prot.com/keyportal/cgi-bin/keyportalorder.pl?u=all&p=tfdsTAdhN&product_id=1&number_of_u=3&type=1&length=d&partner_id=2932&order_ref=16&account_reference_name=audney&account_reference_value=trudith'.

    i just send this Information to Web.

    Kindly help friends

    BI_Group

    Tuesday, January 22, 2013 8:02 AM

Answers

  • The code here should help:

    http://stackoverflow.com/questions/4015324/http-request-with-post

    You would use it in a script task and just substitute in your URL and querystring values

    HttpWebRequest httpWReq =
        (HttpWebRequest)WebRequest.Create("http:\\domain.com\page.asp");
    ASCIIEncoding encoding = new ASCIIEncoding();
    string postData = "username=user";
    postData += "&password=pass";
    byte[] data = encoding.GetBytes(postData);
    httpWReq.Method = "POST";
    httpWReq.ContentType = "application/x-www-form-urlencoded";
    httpWReq.ContentLength = data.Length;
    using (Stream newStream = httpWReq.GetRequestStream())
    {
        newStream.Write(data,0,data.Length);
    }


    Chuck Pedretti | Magenic – North Region | magenic.com

    • Marked as answer by Eileen Zhao Thursday, January 31, 2013 2:16 AM
    Tuesday, January 22, 2013 1:33 PM