#!perl use strict; use warnings; use LWP::UserAgent; my $ua = LWP::UserAgent->new( 'send_te' => '0' ); my $r = HTTP::Request->new( 'POST' => 'https://api.twilio.com/2010-04-01/Accounts/$TWILIO_ACCOUNT_SID/Messages.json', [ 'Accept' => '*/*', 'Authorization' => 'Basic JFRXSUxJT19BQ0NPVU5UX1NJRDokVFdJTElPX0FVVEhfVE9LRU4=', 'User-Agent' => 'curl/7.55.1', 'Content-Length' => '129', 'Content-Type' => 'application/x-www-form-urlencoded' ], "Body=This\x2520is\x2520the\x2520ship\x2520that\x2520made\x2520the\x2520Kessel\x2520Run\x2520in\x2520fourteen\x2520parsecs\x253F&From=\x252B15017122661&To=\x252B15558675310" ); my $res = $ua->request( $r, ); __END__ Created from curl command line curl -X POST https://api.twilio.com/2010-04-01/Accounts/$TWILIO_ACCOUNT_SID/Messages.json --data-urlencode "Body=This is the ship that made the Kessel Run in fourteen parsecs?" --data-urlencode "From=+15017122661" --data-urlencode "To=+15558675310" -u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN