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. Advertisements

  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. Advertisements

  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. Advertisements

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:
    6,087
  2. bret brunner
    Replies:
    1
    Views:
    1,201
    bret brunner
    Aug 21, 2003
  3. Marcelo
    Replies:
    0
    Views:
    1,149
    Marcelo
    Aug 26, 2003
  4. khawar
    Replies:
    2
    Views:
    1,784
    vMike
    Oct 28, 2003
  5. Vishal
    Replies:
    1
    Views:
    857
    Steve C. Orr [MVP, MCSD]
    Dec 21, 2004
  6. Mossman
    Replies:
    0
    Views:
    973
    Mossman
    Dec 12, 2005
  7. Replies:
    1
    Views:
    366
    Sean Chambers
    Sep 29, 2006
  8. Don Glover the younger

    ASP, FORMS, POST METHOD And Post with out form(???)

    Don Glover the younger, Jul 13, 2003, in forum: ASP General
    Replies:
    0
    Views:
    660
    Don Glover the younger
    Jul 13, 2003
Loading...