Sending Http POST request

  • Thread starter Giulio Petrucci
  • Start date
G

Giulio Petrucci

Hi there,

I' have a simple ASP.NET application reciveinf a POST request and using
both HttpContext.Current.Request.Files and
HttpContext.Current.Request.Form.

In order to test the page, I'd need to send a post request cotaining
both files and parameter in form "var1=value1&var2=value2". How can I do
this?

Thanks in advance,
Giulio - Italy
--
 
M

Martin Honnen

Giulio said:
I' have a simple ASP.NET application reciveinf a POST request and using
both HttpContext.Current.Request.Files and
HttpContext.Current.Request.Form.

In order to test the page, I'd need to send a post request cotaining
both files and parameter in form "var1=value1&var2=value2". How can I do
this?

System.Net.WebClient has methods UploadFile and UploadValues but not to
do both with one request. So you would need to implement the request
yourself with (Http)WebRequest I think. Or try to find whether any third
party test framework offers an API.
 
G

Giulio Petrucci

Hi Martin,

Martin Honnen ha scritto:
So you would need to implement the request
yourself with (Http)WebRequest I think.

Exactly.
But shall I just push everything into the request stream?

Thanks,
Giulio
--
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top