All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.testobject.rest.api.resource.v2.ApiVideoResource Maven / Gradle / Ivy

There is a newer version: 0.3.1
Show newest version
package org.testobject.rest.api.resource.v2;

import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.Response;

import static java.util.Base64.getEncoder;

public class ApiVideoResource {

	private final WebTarget target;

	public ApiVideoResource(WebTarget target) {
		this.target = target;
	}

	public Response getScreenRecording(String videoId, String apiKey) {
		String apiKeyHeader = "Basic " + getEncoder().encodeToString((":" + apiKey).getBytes());

		return target
				.path("v2")
				.path("video").path(videoId)
				.request("video/mp4")
				.header("Authorization", apiKeyHeader)
				.get();
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy