curl -X PUT \
https://emailoctopus.com/api/1.6/lists/00000000-0000-0000-0000-000000000000?api_key=00000000-0000-0000-0000-000000000000&name=Foo
|
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://emailoctopus.com/api/1.6/lists/00000000-0000-0000-0000-000000000000?api_key=00000000-0000-0000-0000-000000000000&name=Foo');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
$result = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close($ch);
|
import requests
params = (
('api_key', '00000000-0000-0000-0000-000000000000'),
('name', 'Foo'),
)
response = requests.put('https://emailoctopus.com/api/1.6/lists/00000000-0000-0000-0000-000000000000', params=params)
|
var https = require('https');
var options = {
hostname: 'emailoctopus.com',
port: 443,
path: '/api/1.6/lists/00000000-0000-0000-0000-000000000000?api_key=00000000-0000-0000-0000-000000000000&name=Foo',
method: 'PUT',
};
var req = https.request(options);
req.end();
|
package main
import (
"io/ioutil"
"log"
"net/http"
)
func main() {
client := &http.Client{}
req, err := http.NewRequest("PUT", "https://emailoctopus.com/api/1.6/lists/00000000-0000-0000-0000-000000000000?api_key=00000000-0000-0000-0000-000000000000&name=Foo", nil)
if err != nil {
log.Fatal(err)
}
resp, err := client.Do(req)
if err != nil {
log.Fatal(err)
}
bodyText, err := ioutil.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
}
|