[This was edited by @mark to resurrect the formatting and image]
Hello
I would like some help creating a HTML POST to the twilio api.
Sample code twilio have provided is. (they also provide alternative formats)
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;
$sid = '<AccountSid>';
$token = '<AuthToken>';
$client = new Client($sid, $token);
$client->messages->create(
'<customer_phone_number>',
array(
'from' => '<your_twilio_number>',
'body' => 'text content',
)
);
I have attempted to create a HTTP request using the POST method in this format
POST https://api.twilio.com/2010-04-01/Accounts/ [My Account Number]/Messages
Authorization: Basic [My Auth token]
Host: api.twilio.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 50
To=555555555&From=555555556&Body=text content
The image shows how I’ve tried to do this. I don’t have experience in this area so everything I’ve done is via google, therefore I’m potentially way off.
I think this is probably a simple thing to do but as I’m inexperienced I’m struggling.
Thanks