C#C
C#3y ago
T3CH

❔ 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
var request = WebRequest.Create("https://accounts.spotify.com/api/token");
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
Was this page helpful?