❔ c# post request http body
hi! im trying to make a post request to the spotify api, and i cant figure out how to add a body to the request with the value
"grant_type=client_credentials&client_id=your-client-id&client_secret=your-client-secret"
my current code is
10 Replies
Use HttpClient, it's more up-to date (faster) and a lot easier.
That's the gist of it with HttpClient
im pretty new to c# whats await
$async
For an introduction to
async
and await
in C#, https://blog.stephencleary.com/2012/02/async-and-await.htmlAsync and Await
Most people have already heard about the new “async” and “await” functionality coming in Visual Studio 11. This is Yet Another Introductory Post.
i'll check that out
All you need to remember, though, is
1. If a method is
async
, you need to await
it
2. If a method does any await
ing it needs to be async
3. If a method is async
it has to return Task
or Task<T>
im stuck where i would go from here
how do i input the content type and the http body
Angius
Quoted by
<@85903769203642368> from #c# post request http body (click here)
React with ❌ to remove this embed.
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.