Advertisement
Guest User

Untitled

a guest
Aug 30th, 2016
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. CloseableHttpClient client = HttpClientBuilder.create().build();
  2. HttpRequestBase request = null;
  3. String url = "https://api.vimeo.com/videos/180564305/files";
  4. request = new HttpPut(url);
  5.  
  6. // needed for authentication
  7. request.addHeader("Accept", "application/vnd.vimeo.*+json; version=3.2");
  8. request.addHeader("Authorization", new StringBuffer(tokenType).append(" ").append(token).toString());
  9.  
  10. UrlEncodedFormEntity entity = null;
  11. ArrayList<NameValuePair> postParameters = new ArrayList<NameValuePair>();
  12. for (String key : params.keySet()) {
  13. postParameters.add(new BasicNameValuePair(key, params.get(key)));
  14. }
  15. entity = new UrlEncodedFormEntity(postParameters, "utf-8");
  16.  
  17. ((HttpPost) request).setEntity(entity);
  18.  
  19. CloseableHttpResponse response = client.execute(request);
  20.  
  21. Json:
  22. {
  23. "X-Cache": "MISS, MISS",
  24. "Server": "nginx",
  25. "Connection": "keep-alive",
  26. "X-RateLimit-Reset": "2016-08-30T11:41:40+00:00",
  27. "Date": "Tue, 30 Aug 2016 11:26:40 GMT",
  28. "Via": "1.1 varnish",
  29. "X-Timer": "S1472556400.083619,VS0,VE212",
  30. "Accept-Ranges": "bytes",
  31. "Fastly-Debug-Digest": "b78ad11f91fb08928c481b803610a748f4633995ee78c497257187ce22649305",
  32. "Strict-Transport-Security": "max-age=15120000; includeSubDomains; preload",
  33. "X-RateLimit-Remaining": "97",
  34. "Cache-Control": "no-cache, max-age=315360000",
  35. "X-Served-By": "cache-iad2137-IAD, cache-fra1244-FRA",
  36. "Vary": "Accept,Vimeo-Client-Id,Accept-Encoding",
  37. "X-RateLimit-Limit": "100",
  38. "Expires": "Fri, 28 Aug 2026 11:26:40 GMT",
  39. "X-Cache-Hits": "0, 0",
  40. "Content-Type": "application/vnd.vimeo.uploadticket+json"
  41. }
  42.  
  43. Json:
  44. {
  45. "uri": "/users/user54114628/tickets/...",
  46. "ticket_id": "...",
  47. "user": {...},
  48. "upload_link": "http://1511923754.cloud.vimeo.com/upload?ticket_id=...&video_file_id=...&signature=...&v6=1",
  49. "upload_link_secure": "https://1511923754.cloud.vimeo.com/upload?ticket_id=...&video_file_id=...&signature=...&v6=1",
  50. "complete_uri": "/users/54114628/tickets/...?video_file_id=...&upgrade=true&signature=..."
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement