mfalconmtz
asked on
HttpWebRequest with GET and POST
I want to send data to a url via HttpWebRequest in ASP.net but I need to send some data via GET method and another data via POST method, is it possible? How do I send it?
Are you saying that you want to send both GET and POST data in the same request. I think that's possible. You can encode the GET data as Query String, but still set the request method as POST and write the POST data into the request stream.
ASKER
If I use:
req = CType(WebRequest.Create("http://mydomain/Link.aspx?opt=0949889EA5EA&type=simple&pass=False" ), HttpWebRequest)
I send opt, type and pass via GET?
req = CType(WebRequest.Create("http://mydomain/Link.aspx?opt=0949889EA5EA&type=simple&pass=False"
I send opt, type and pass via GET?
Well, to be correct, actually you are sending those through query string. However, if you are making GET request, the only way you can pass parameters is also through query string.
Btw, what do you want to achieve actually? Maybe if you can tell use more, we can provide better suggestion ...
Btw, what do you want to achieve actually? Maybe if you can tell use more, we can provide better suggestion ...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I want to suscribe e-mail addresses to a mailing list via code, the form to suscribe to this list send query string parameters and the name and e-mail address with a POST like this.
<form method="POST" action="http://mydomain/Link.aspx?opt=0949889EA5EA&type=simple&pass=False">
<input type="text" name="name">
<input type="text" name="email">
</form>
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.