Professional Web Applications Themes

How to post some data in form of POST action of forms in asp? - ASP Components

Hi there, I need to post some information into an ASP page (mypage.asp), in form of POST action which I do with the following code: 'contents of mypostpage.asp Set objWinHttp = Server.CreateObject("WinHttp.WinHttpRequest.5") objWinHttp.Open "put", "http://mylocalhostaddress/mywebsite/mypage.asp", False objWinHttp.Send "pid1=1400&pid2=122" Response.Write "Status: " & objWinHttp.Status Set objWinHttp = Nothing However, I get the 403 Error code, say, HTTP/1.1 403 Forbidden. So I think something goes wrong with the above code! What I'm trying to achieve is to post some plain data into that destination page of someone else. <form action='post'> <input type='hidden' name='pid1' value='1400'> <input type='hidden' name='pid2' value='122'> </form> Does the above ...

  1. #1

    Default How to post some data in form of POST action of forms in asp?

    Hi there,
    I need to post some information into an ASP page (mypage.asp), in form of
    POST action which I do
    with the following code:

    'contents of mypostpage.asp

    Set objWinHttp = Server.CreateObject("WinHttp.WinHttpRequest.5")
    objWinHttp.Open "put", "http://mylocalhostaddress/mywebsite/mypage.asp",
    False
    objWinHttp.Send "pid1=1400&pid2=122"
    Response.Write "Status: " & objWinHttp.Status
    Set objWinHttp = Nothing

    However, I get the 403 Error code, say, HTTP/1.1 403 Forbidden. So I think
    something goes wrong with the above code!

    What I'm trying to achieve is to post some plain data into that destination
    page of someone else.

    <form action='post'>
    <input type='hidden' name='pid1' value='1400'>
    <input type='hidden' name='pid2' value='122'>
    </form>

    Does the above code post the same data as the above html form?

    Any help would be highly appreciated,

    Cheers,
    M.Mousavi


    Mehdi Mousavi Guest

  2. #2

    Default Re: How to post some data in form of POST action of forms in asp?

    > Set objWinHttp = Server.CreateObject("WinHttp.WinHttpRequest.5")

    Ugh, don't use WinHttp directly. See [url]www.aspfaq.com/2173[/url]



    Aaron Bertrand - MVP Guest

Similar Threads

  1. redirect but with post data - mimick form post behaviour
    By LuckyNinja in forum Coldfusion - Advanced Techniques
    Replies: 4
    Last Post: April 14th, 05:58 PM
  2. Replies: 7
    Last Post: September 29th, 06:03 PM
  3. #24013 [Com]: Missing Form Post Data
    By michael dot lindner at gmlindner dot de in forum PHP Development
    Replies: 0
    Last Post: September 12th, 04:59 PM
  4. form data will not post
    By Nomen Nescio in forum PHP Development
    Replies: 10
    Last Post: August 13th, 11:48 AM
  5. ASP, FORMS, POST METHOD And Post with out form(???)
    By Don Glover the younger in forum ASP
    Replies: 2
    Last Post: July 13th, 03:27 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139