Seems that you are setting the wrong content type, at least it does not match the official documentation which requires application/json:
|
Vimeo.prototype.accessToken = function (code, redirectUri, fn) { |
|
const options = { |
|
method: 'POST', |
|
hostname: module.exports.request_defaults.hostname, |
|
path: authEndpoints.accessToken, |
|
query: { |
|
grant_type: 'authorization_code', |
|
code, |
|
redirect_uri: redirectUri |
|
}, |
|
headers: { |
|
'Content-Type': 'application/x-www-form-urlencoded' |
|
} |
|
} |
The function responses with in such case is:
<!doctype html>
<html lang="en">
<head>
<title>HTTP Status 400 – Bad Request</title>
<style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style>
</head>
<body>
<h1>HTTP Status 400 – Bad Request</h1>
</body>
</html>
Seems that you are setting the wrong content type, at least it does not match the official documentation which requires
application/json:vimeo.js/lib/vimeo.js
Lines 333 to 346 in ef0771e
The function responses with in such case is: