Hi glorious people of the forums. Ive been trying to mess around with a spotify-songrequest kind of thing and part of that is authorization. to obtain a refresh token (which are used to prevent access tokens from expiring) i need to POST to spotify's account server as explained on the 4th step of https://developer.spotify.com/web-api/authorization-guide/

basically they want you to add the body parameters 'grant_type' 'code' and 'redirect_url' and i have no idea how to do that.

so far i have this and its returning 500's
Code:
on *:sockopen:oauth: { 
  msg #sjoepele  [DEBUG] oauth initialized
  sockwrite -n $sockname POST /api/token HTTP/1.1
  sockwrite -n $sockname Host: accounts.spotify.com
  sockwrite -n $sockname Authorization: Basic <base64 encoded client secret:clientid censored>
  sockwrite -n $sockname Accept-Encoding: compress
  sockwrite -n $sockname Accept: application/json
  sockwrite -n $sockname Connection: close
  sockwrite -n $sockname 
  sockwrite -n $sockname grant_type=authorization_code
  sockwrite -n $sockname code= <authorization code censored>
  sockwrite -n $sockname redirect_uri=http://localhost/
}


tl;dr have to add body parameters and don't know how

If someone could help me out that would be greatly appreciated ^_^