I am trying to return an access token for the youtube API but do not know how to format this POST in JQuery
POST /oauth2/v4/token HTTP/1.1
Host: www.googleapis.com
Content-length: 184
content-type: application/x-www-form-urlencoded
user-agent: google-oauth-playground
client_secret=************&grant_type=refresh_token&refresh_token=1%2FPHiWsKPQXQJCNKBbTPgiR0QHugKlXp8Pd2cRlohjK80hAConmTyV5XVmg2HfO4Ag&client_id=407408718192.apps.googleusercontent.com
Thanks for any help!
EDIT: This is my code so far
jQuery.ajax({
url: "https://www.googleapis.com/oauth2/v4/token/",
type: "post",
data: {
grant_type: "refresh_token",
refresh_token: 'token here',
client_id: 'id here',
client_secret: 'secret here',
access_type: 'offline',
},
success: function(response){
console.log(response)
}
})
};