CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > migration_to_asp.net.migrating_from_asp_to_asp.net Tags:
Item Type: NewsGroup Date Entered: 5/2/2006 2:50:03 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 3 Views: 678 Favorited: 0 Favorite
4 Items, 1 Pages 1 |< << Go >> >|
blancomario
Asp.Net User
How to pass parameters with HTTPWebRequest?5/2/2006 2:50:03 PM

0

I am converting a classic ASP application to a .NET 2.0 application and I am having problems trying to figure out how to pass parameters when making the HTTP call.

In my classic ASP I have the following code

strSend = "fields="&returnFields&"&pernr="&eIDs

Set xml = Server.CreateObject("Microsoft.XMLHTTP")
xml.Open "POST", "http://mypioneer.phibred.com/ews/post", False
xml.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
xml.Send strSend - where I am passing the parameters

In the ASP.NET page I have coded so far

Dim strPostData As String = "fields=" & strFieldInfo & "&username=" & strUsername

Dim myHttpWebRequest As HttpWebRequest = WebRequest.Create("http://mypioneer.phibred.com/ews/post")

myHttpWebRequest.Method = "post"

myHttpWebRequest.ContentType = "application/x-www-form-urlencoded"

I can figure what method to use so I can pass the strPostData as the parameter like it was done in the classic ASP sample above.

I appreciate your help.

 

joteke
Asp.Net User
Re: How to pass parameters with HTTPWebRequest?5/2/2006 7:33:23 PM

0

Hi,

you would get the request stream with call to GetRequestStream and then using the returned stream, you'd write the params.

Please see: http://msdn2.microsoft.com/en-us/library/system.net.httpwebrequest.getrequeststream(VS.80).aspx 


Thanks,

Teemu Keiski
Finland, EU
marafacs
Asp.Net User
Re: How to pass parameters with HTTPWebRequest?10/3/2006 7:46:29 AM

0

Dear joteke,

 i have an asp page,with the username & password,and i want from my .net web application to POST data to the login page,and then get the response of that page.....how can i get that response......and check for it.


Moustafa M.Arafa
DotNet Boom Supportive Development Manager
C# MVP,MCT,MCSD.Net,MCTS
http://www.dotnetboom.net

danish321
Asp.Net User
Re: How to pass parameters with HTTPWebRequest?1/17/2008 11:18:46 AM

0

Hi blancomario .

Dim strPostData As String = "fields=" & strFieldInfo & "&username=" & strUsername

 

Dim myHttpWebRequest As HttpWebRequest = WebRequest.Create("http://mypioneer.phibred.com/ews/post")

 

myHttpWebRequest.Method = "post"

myHttpWebRequest.ContentType = "application/x-www-form-urlencoded"

 

 after building the post data then write it on the URL like below given code.

StreamWriter postwriter = new StreamWriter(myHttpWebRequest dsds.GetRequestStream());

postwriter.Write(postData);

postwriter.Close();

 

Hope this helps Smile

4 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Programming C# Authors: Jesse Liberty, Pages: 644, Published: 2005
Programming C# 3.0 Authors: Jesse Liberty, Donald Xie, Pages: 587, Published: 2007
Professional C# 2005 Authors: Christian Nagel, Bill Evjen, Allen Jones, Pages: 1540, Published: 2005
Visual Basic programmer's guide to the .NET framework class library Authors: Lars Powers, Mike Snell, Pages: 1122, Published: 2002

Web:
How to pass parameters with HTTPWebRequest? - ASP.NET Forums Re: How to pass parameters with HTTPWebRequest? 05-02-2006, 3:33 PM. Contact ... Re: How to pass parameters with HTTPWebRequest? 10-03-2006, 3:46 AM ...
How to pass parameters with HTTPWebRequest? - ASP.NET Forums NET 2.0 application and I am having problems trying to figure out how to pass parameters when making the HTTP call. ...
WebRequest - passing parameters using POST C# Friends How do I make a call to a URI and pass parameters using the POST method? So far, all the documenation I've seen is: WebRequest req = new ...
CodeProject: How to use HttpWebRequest and HttpWebResponse in .NET ... Mar 28, 2004 ... Pass the desired parameters in BaseHttp class constructor. Inside of try - catch block: HttpWebRequest webrequest = BaseHttp. ...
How to pass the parameters in silverlight control to aspx pages ... could you show me example to use HttpWebRequest or XmlHttpRequest ? .... give me a very useful method to pass parameters between Silverlight ...

How to pass parameters with HTTPWebRequest? - ng.asp-net-forum ... How to pass parameters with HTTPWebRequest?, > ROOT > NEWSGROUP > Asp.Net Forum > migration_to_asp.net.migrating_from_asp_to_asp.net, ...












like operator in c#

impact of migration on support?

newbie to asp.net, help with a gridview control that has submit buttons

execute a method dynamically

confused and dazzled - pls help

url and query string ???

asp tp asp.net session error

getting post / get variable on an aspx.page from an asp page

classic .asp renamed to .aspx

migration from asp to asp.net

createobject fails in aspx page

getting a system.stackoverflowexception in iis using lots of #include

migration assistant doesn't copy/migrate some files

asp to asp.net conversion

asp code to asp.net equivalent

need help to translate asp to asp.net 2.0

class not registered (80040154) error

how would i accomplish the same functionality in every page. in asp application? in the asp.net application?

asp class to asp.net migration

tlbimp.exe not working

how do i call a stored procedure from database using com components from .asp page.

moving from old asp to .net - need direction

"eval" function in .net?

i need asp.net code of this asp code's

asp compiler for microsoft .net

calling classic asp functions

migration of asp project to .net

migration assistant from asp to asp.net 3.5 using vs.net 2008

com interop dll

how can i get breadarray to work?

 
Search This Site:

 
  Privacy | Contact Us
All Times Are GMT