I'm trying to convert a cURL command to a retrofit call. The cURL command is:
curl -u {username}:{password} -X POST
--header "Content-Type: audio/wav"
--header "Transfer-Encoding: chunked"
--data-binary @{audiofile}.wav
"{url}" -i -v
I already converted the -u command by adding a Base64 of the username and password as the Authorization header. I've also added the other header. However the problem is with the retrofit call. The Retrofit call is currently:
@POST
@Headers({"Transfer-Encoding: chunked", "Content-Type: audio/wav"})
Call<Station> translateAudio(@Url String url, @Header("Authorization") String auth,
@Body RequestBody file);
When using the cURL command the audio file gets processed correctly on the server. However when I try the retrofit call I'm getting an error from the service I'm using. It seems there is a difference between the retrofit call and the cURL one. Does anyone know what the difference is? The credentials do get accepted, so that's not the problem.