i'm trying to invoke a webapi with the new System.Net.WebClient and didnot found any special examples.
The goal is simulate a traditional form post with some fields and a file.
how can i do it using the System.Net.WebClient or where can i find some examples?
thanks in advance
There are a lot of examples if you do a fast google search, anyway, here goes some samples:
Simple GET
Simple POST
There's also an UploadData that sends byte arrays and UploadFile that allows you to upload files directly from disk.
I think you need this:
http://dzimchuk.net/post/uploading-a-file-over-http-in-net
This is a very well written blog. See the last example.