Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CloseableHttpClient client = HttpClientBuilder.create().build();
- HttpRequestBase request = null;
- String url = "https://api.vimeo.com/videos/180564305/files";
- request = new HttpPut(url);
- // needed for authentication
- request.addHeader("Accept", "application/vnd.vimeo.*+json; version=3.2");
- request.addHeader("Authorization", new StringBuffer(tokenType).append(" ").append(token).toString());
- UrlEncodedFormEntity entity = null;
- ArrayList<NameValuePair> postParameters = new ArrayList<NameValuePair>();
- for (String key : params.keySet()) {
- postParameters.add(new BasicNameValuePair(key, params.get(key)));
- }
- entity = new UrlEncodedFormEntity(postParameters, "utf-8");
- ((HttpPost) request).setEntity(entity);
- CloseableHttpResponse response = client.execute(request);
- Json:
- {
- "X-Cache": "MISS, MISS",
- "Server": "nginx",
- "Connection": "keep-alive",
- "X-RateLimit-Reset": "2016-08-30T11:41:40+00:00",
- "Date": "Tue, 30 Aug 2016 11:26:40 GMT",
- "Via": "1.1 varnish",
- "X-Timer": "S1472556400.083619,VS0,VE212",
- "Accept-Ranges": "bytes",
- "Fastly-Debug-Digest": "b78ad11f91fb08928c481b803610a748f4633995ee78c497257187ce22649305",
- "Strict-Transport-Security": "max-age=15120000; includeSubDomains; preload",
- "X-RateLimit-Remaining": "97",
- "Cache-Control": "no-cache, max-age=315360000",
- "X-Served-By": "cache-iad2137-IAD, cache-fra1244-FRA",
- "Vary": "Accept,Vimeo-Client-Id,Accept-Encoding",
- "X-RateLimit-Limit": "100",
- "Expires": "Fri, 28 Aug 2026 11:26:40 GMT",
- "X-Cache-Hits": "0, 0",
- "Content-Type": "application/vnd.vimeo.uploadticket+json"
- }
- Json:
- {
- "uri": "/users/user54114628/tickets/...",
- "ticket_id": "...",
- "user": {...},
- "upload_link": "http://1511923754.cloud.vimeo.com/upload?ticket_id=...&video_file_id=...&signature=...&v6=1",
- "upload_link_secure": "https://1511923754.cloud.vimeo.com/upload?ticket_id=...&video_file_id=...&signature=...&v6=1",
- "complete_uri": "/users/54114628/tickets/...?video_file_id=...&upgrade=true&signature=..."
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement