madhouse
madhouse

Reputation: 183

Vimeo progress request returns "options.uri is a required argument"

Having issues completing a PUT upload using Vimeo's API. An upload progress call returns: "Error: options.uri is a required argument."

Mind you, everything does seem to upload properly; I am just very leery of success in the presence of errors.

Relevant code (Node.js) follows:

app.post('/api/vimeo/complete', function(req, res) {
request({
    method: 'PUT',
    json: true,
    url: req.body.upload_link_secure,
    headers: {
        'Authorization': 'Bearer OBSCURO-PATRONUM',
        'Content-Range': '*/*'
    }
}, function(error, response, body){
    //console.log('Headers: ' + JSON.stringify(response.headers));
    console.log('progress error: ' + error);
    fs.writeFile('server_logs/vimeo-progress-log.json', JSON.stringify(response), function(err) {
        if (err) {
            console.log('log writing error: ' + err);
        } else {
            console.log('Vimeo progress log written.');
        }
    });
    res.json(body);
});
request({
    method: 'DELETE',
    json: true,
    url: 'https://api.vimeo.com' + req.body.uri,
    headers: {
        'Authorization': 'Bearer OBSCURO-PATRONUM'
    }
}, function(error, response, body){
    console.log('complete error: ' + error);
    console.log('complete body: ' + body);
    res.json(body);
});
});

Upvotes: 0

Views: 4383

Answers (1)

Dashron
Dashron

Reputation: 3998

Try using uri instead of url in the object passed to the request method. The docs claim both work (https://github.com/request/request#requestoptions-callback) but you might be using a different version of the library.

This definitely sounds like a request error, not a vimeo error.

Upvotes: 1

Related Questions