Skip to content

Commit

Permalink
Undo undesired changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Swimburger committed Mar 9, 2024
1 parent 34823be commit ddb52dc
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,24 @@ public FilesClient(ClientOptions clientOptions) {
/**
* Upload your media file directly to the AssemblyAI API if it isn't accessible via a URL already.
*/
public UploadedFile upload() {
return upload(null);
public UploadedFile upload(byte[] request) {
return upload(request, null);
}

/**
* Upload your media file directly to the AssemblyAI API if it isn't accessible via a URL already.
*/
public UploadedFile upload(RequestOptions requestOptions) {
public UploadedFile upload(byte[] request, RequestOptions requestOptions) {
HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v2/upload")
.build();
RequestBody body = RequestBody.create(request);
Request okhttpRequest = new Request.Builder()
.url(httpUrl)
.method("POST", RequestBody.create("", null))
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
.addHeader("Content-Type", "application/octet-stream")
.build();
try {
OkHttpClient client = clientOptions.httpClient();
Expand Down

0 comments on commit ddb52dc

Please sign in to comment.