Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re^2: Translate curl to LWP

by Anonymous Monk
on Nov 13, 2018 at 17:05 UTC ( #1225731=note: print w/replies, xml ) Need Help??

in reply to Re: Translate curl to LWP
in thread Translate curl to LWP

Hi Holli. I need to work on a machine without curl, this is the reason why I am trying to port this crul command.

Replies are listed 'Best First'.
Re^3: Translate curl to LWP
by holli (Monsignor) on Nov 13, 2018 at 18:57 UTC
    holli@DESKTOP-46NMP4B:~$ curl -v -X POST -i -u "apikey:xxx" --header " +Content-Type: audio/flac" --data-binary x.flac "https://stream-fra.wa" Note: Unnecessary use of -X or --request, POST is already inferred. * Trying * TCP_NODELAY set * Connected to ( port 443 + (#0) * ALPN, offering h2 * ALPN, offering http/1.1 * successfully set certificate verify locations: * CAfile: /etc/ssl/certs/ca-certificates.crt CApath: /etc/ssl/certs * TLSv1.2 (OUT), TLS handshake, Client hello (1): * TLSv1.2 (IN), TLS handshake, Server hello (2): * TLSv1.2 (IN), TLS handshake, Certificate (11): * TLSv1.2 (IN), TLS handshake, Server key exchange (12): * TLSv1.2 (IN), TLS handshake, Server finished (14): * TLSv1.2 (OUT), TLS handshake, Client key exchange (16): * TLSv1.2 (OUT), TLS change cipher, Client hello (1): * TLSv1.2 (OUT), TLS handshake, Finished (20): * TLSv1.2 (IN), TLS handshake, Finished (20): * SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384 * ALPN, server accepted to use http/1.1 * Server certificate: * subject: C=US; ST=New York; L=Armonk; O=INTERNATIONAL BUSINESS MACH +INES CORPORATION; CN=* * start date: Jan 9 00:00:00 2018 GMT * expire date: Mar 9 12:00:00 2020 GMT * subjectAltName: host "" matched cert's + "*" * issuer: C=US; O=DigiCert Inc;; CN=GeoTrust RSA +CA 2018 * SSL certificate verify ok. * Server auth using Basic with user 'apikey' > POST /speech-to-text/api/v1/recognize HTTP/1.1 > Host: > Authorization: Basic YXBpa2V5Onh4eA== > User-Agent: curl/7.58.0 > Accept: */* > Content-Type: audio/flac > Content-Length: 6 > * upload completely sent off: 6 out of 6 bytes < HTTP/1.1 401 Unauthorized HTTP/1.1 401 Unauthorized < Date: Tue, 13 Nov 2018 18:52:41 GMT Date: Tue, 13 Nov 2018 18:52:41 GMT < Content-Type: application/json Content-Type: application/json < Content-Length: 37 Content-Length: 37 < Connection: keep-alive Connection: keep-alive * Authentication problem. Ignoring this. < Www-Authenticate: Basic realm="IBM Watson Gateway(Log-in)" Www-Authenticate: Basic realm="IBM Watson Gateway(Log-in)" < * Connection #0 to host left intact {"code":401, "error": "Unauthorized"}
    Apparently the authentication with the server is not working. See here for on how to send them credentials properly.


    You can lead your users to water, but alas, you cannot drown them.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1225731]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (9)
As of 2018-12-14 21:59 GMT
Find Nodes?
    Voting Booth?
    How many stories does it take before you've heard them all?

    Results (69 votes). Check out past polls.