-
Notifications
You must be signed in to change notification settings - Fork 25.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTP POST example? #12580
HTTP POST example? #12580
Comments
As mentioned by @suarezafelipe, I am too waiting for the POST request example. |
@stevejgordon can you create a POST sample? |
I'd like to add my voice to a request for a post example along with collecting an expected response object. |
I finally managed it. The following controller action uses a named HttpClient to post two parameters (clientId and secret) to a remote API in order to request a jwt token as the response. The parameters are each strings and they were posted as a single JSON object which contained them.
Hope that helps someone else! This is actually very useful now that it is going. I will move this method out of the controller and use it as a service that supplies a token on request, and it will only require a single HttpClient be generated to do so. Pretty neat. |
What we need is a simpler sample - for example, calling the web API sample |
I'm also looking forward to having one. Will it be used like.net before?Not dependency injection, because we're going to write a generic library that can be used like.net before
need an example |
@serpent5 any chance you could write the code for this? |
Moved to master issue: Make HTTP requests using IHttpClientFactory #16641 |
@Rick-Anderson Yeah, sure. |
This page is ranking # 2 on google for "send http post request in .net core" and yet it does not contain a single example on how to send a POST request.
I understand this might not be the place to put such documentation, but I haven't been able to find a single post request example in the .net core official docs.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: