Performing a POST from asp(.net) ?

Discussion in 'ASP .Net' started by +Bob+, Oct 19, 2007.

  1. +Bob+

    +Bob+ Guest

    Does ASP and/or ASP.net have any modules that can be used to perform
    HTTP POSTs to web pages and forms?

    This would be an application where there would be one form for the end
    user to fill out - then the called asp(.net) program would set up the
    data to be passed by POST (HTTP Headers) and call the ASP or CGI that
    further processes the data.

    Thanks,
    +Bob+, Oct 19, 2007
    #1
    1. Advertising

  2. On Oct 19, 5:02 am, +Bob+ <> wrote:
    > Does ASP and/or ASP.net have any modules that can be used to perform
    > HTTP POSTs to web pages and forms?
    >
    > This would be an application where there would be one form for the end
    > user to fill out - then the called asp(.net) program would set up the
    > data to be passed by POST (HTTP Headers) and call the ASP or CGI that
    > further processes the data.
    >
    > Thanks,


    Look at the HttpWebRequest

    HttpWebRequest request =
    (HttpWebRequest)HttpWebRequest.CreateDefault(url);
    request.ContentType = "application/x-www-form-urlencoded";
    request.Method = "POST";
    request.ContentLength = ...;

    and so forth
    Alexey Smirnov, Oct 19, 2007
    #2
    1. Advertising

  3. +Bob+ wrote:
    > Does ASP and/or ASP.net have any modules that can be used to perform
    > HTTP POSTs to web pages and forms?
    >
    > This would be an application where there would be one form for the end
    > user to fill out - then the called asp(.net) program would set up the
    > data to be passed by POST (HTTP Headers) and call the ASP or CGI that
    > further processes the data.
    >
    > Thanks,
    >


    You can use the HttpWebRequest class or the WebClient class to post data.

    If you have any control over how the server will recieve the data, you
    should consider setting up a web service instead of using HTTP posts. In
    ASP.NET you can add a reference to a web service, and it automatically
    creates a class with methods that you can use to call the web service.

    --
    Göran Andersson
    _____
    http://www.guffa.com
    =?ISO-8859-1?Q?G=F6ran_Andersson?=, Oct 19, 2007
    #3
  4. +Bob+

    +Bob+ Guest

    On Fri, 19 Oct 2007 13:03:27 +0200, Göran Andersson <>
    wrote:

    >You can use the HttpWebRequest class or the WebClient class to post data.
    >
    >If you have any control over how the server will recieve the data, you
    >should consider setting up a web service instead of using HTTP posts. In
    >ASP.NET you can add a reference to a web service, and it automatically
    >creates a class with methods that you can use to call the web service.


    Thanks... I'm calling to other people's forms, so I have no control
    over the server.
    +Bob+, Oct 19, 2007
    #4
  5. +Bob+

    +Bob+ Guest

    On Fri, 19 Oct 2007 06:57:51 -0000, Alexey Smirnov
    <> wrote:

    >Look at the HttpWebRequest
    >
    >HttpWebRequest request =
    >(HttpWebRequest)HttpWebRequest.CreateDefault(url);
    >request.ContentType = "application/x-www-form-urlencoded";
    >request.Method = "POST";
    >request.ContentLength = ...;
    >
    >and so forth


    Thanks.
    +Bob+, Oct 19, 2007
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Wes Stebbins
    Replies:
    1
    Views:
    5,767
  2. Marcelo
    Replies:
    0
    Views:
    1,031
    Marcelo
    Aug 26, 2003
  3. Fredrik Arenhag

    Security-exception when performing File.Move()

    Fredrik Arenhag, Jan 13, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    3,091
    Fredrik Arenhag
    Jan 14, 2004
  4. Mossman
    Replies:
    0
    Views:
    784
    Mossman
    Dec 12, 2005
  5. Replies:
    1
    Views:
    308
    Sean Chambers
    Sep 29, 2006
Loading...

Share This Page