curl -X POST \ -u "apikey:xxx" \ --header "Content-Type: audio/flac" \ --data-binary @{path_to_file}audio-file.flac \ "https://stream-fra.watsonplatform.net/speech-to-text/api/v1/recognize" #### my $url="https://stream-fra.watsonplatform.net/speech-to-text/api/v1/recognize"; my $apikey="xxx"; open($fh, "<", "audio-file.flac") or die "Can't read file: $!"; my $audio = do { local $/; <$fh> }; close($fh); $ua = LWP::UserAgent->new(); $response = $ua->post( $url, apikey => $apikey, Content_Type => 'audio/flac', Content => $audio );