Skip to content

Commit

Permalink
Merge pull request #98 from mohibsheth/master
Browse files Browse the repository at this point in the history
* Fix pull upload
  • Loading branch information
mfilippov authored Sep 8, 2017
2 parents 78684cb + 39be3da commit 1a1ff1f
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/VimeoDotNet/VimeoClient_Upload.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using VimeoDotNet.Exceptions;
using VimeoDotNet.Models;
using VimeoDotNet.Net;
using VimeoDotNet.Parameters;

namespace VimeoDotNet
{
Expand Down Expand Up @@ -232,13 +233,19 @@ public async Task<Video> UploadPullLinkAsync(string link)
{
try
{
var request = GenerateUploadTicketRequest("pull");
request.Query.Add("link", link);
var response = await request.ExecuteRequestAsync<Video>();
UpdateRateLimit(response);
CheckStatusCodeError(null, response, "Error generating upload ticket.");

return response.Content;
var param = new ParameterDictionary();
param.Add("type", "pull");
param.Add("link", link);

var request = ApiRequestFactory.AuthorizedRequest(
AccessToken,
HttpMethod.Post,
Endpoints.UploadTicket,
null,
param
);

return await ExecuteApiRequest<Video>(request);
}
catch (Exception ex)
{
Expand Down

0 comments on commit 1a1ff1f

Please sign in to comment.