Linked Questions
177 questions linked to/from Send HTTP POST request in .NET
143 votes
3 answers
232k views
How do I set an HTTP Web Request's body data? [duplicate]
I'm creating a web request in ASP.NET and I need to add a bunch of data to the body. How do I do that? var request = HttpWebRequest.Create(targetURL); request.Method = "PUT"; response = (...
4 votes
8 answers
19k views
Remote HTTP Post with C# [duplicate]
How do you do a Remote HTTP Post (request) in C#?
5 votes
2 answers
26k views
How make an HTTP request in C# [duplicate]
How do i make a curl request in c# in windows or i want to make web request with this parameters and it should receive a valid response request curl 'http://www1.bloomingdales.com/api/store/v2/...
4 votes
1 answer
50k views
Sending a POST request to a URL from C# [duplicate]
I have a Node server hosted with Azure, where I can send a POST request to the API for it to perform some function. The API itself works, I have tested it with Post Man. A call to the API would look ...
0 votes
1 answer
11k views
How to send Post with parameters [duplicate]
I want to send POST with parameters, but I don't know how to do it. My code: Uri resourceAddress = new Uri("http://web.com/geo"); try { HttpResponseMessage response=await httpClient.PostAsync(...
0 votes
1 answer
2k views
I want to make a post request in c# [duplicate]
How can i make the following post request in c# fetch("http://172.16.1.1:8090/login.xml", { "headers": { "accept": "*/*", "accept-language": ...
0 votes
1 answer
975 views
HTTP Post from c#.net [duplicate]
Our third party payment gateway provider only supports the FORM POST for handshake, payment and payment verification etc. For this we need to perform a POST from C#.NET. Could someone help me whether ...
0 votes
1 answer
278 views
C# Download webpage content with given parameters [duplicate]
I have a problem. I am trying to get the content of my webpage, so I found this code: WebClient client = new WebClient(); string downloadString = client.DownloadString("mysite.org/page.php"); But I ...
0 votes
0 answers
200 views
How can i post resquest in C# as similar to python [duplicate]
Python code to c# .net for HTTP Post to API response = requests.post(auth_url, auth=('apitoken', api_token), data={'grant_type': 'client_credentials'}) response.raise_for_status() access_token = ...
0 votes
0 answers
83 views
Question about rest api, How to correctly send a post request [duplicate]
for example, spring boot has annotations for certain methods (post, get, request body, etc..) What attributes should be supplied for the arguments in the method, for example: [HttpPost] public ...
291 votes
24 answers
396k views
Mocking HttpClient in unit tests
I have some issues trying to wrap my code to be used in unit tests. The issues is this. I have the interface IHttpHandler: public interface IHttpHandler { HttpClient client { get; } } And the ...
277 votes
6 answers
252k views
Deciding between HttpClient and WebClient [closed]
Our web application is running in .NET Framework 4.0. The UI calls the controller methods through Ajax calls. We need to consume the REST service from our vendor. I am evaluating the best way to ...
186 votes
3 answers
186k views
What difference is there between WebClient and HTTPWebRequest classes in .NET?
What difference is there between the WebClient and the HttpWebRequest classes in .NET? They both do very similar things. In fact, why weren't they merged into one class (too many methods/variables etc ...
44 votes
9 answers
24k views
System.Net.WebClient unreasonably slow
When using the System.Net.WebClient.DownloadData() method I'm getting an unreasonably slow response time. When fetching an url using the WebClient class in .NET it takes around 10 sec before I get a ...
44 votes
4 answers
182k views
C#: HttpClient with POST parameters
I use codes below to send POST request to a server: string url = "http://myserver/method?param1=1¶m2=2" HttpClientHandler handler = new HttpClientHandler(); HttpClient httpClient = new ...