Delete Customer
Delete a customer
delete
https://
{BASE_URL}/customer/{customer_id}
CODE SAMPLES
HTTP
DELETE /v1/customer/:customer_id HTTP/1.1
Host: {BASE_URL}
Nodejs Axios
var axios = require('axios');
var config = {
method: 'delete',
url: '{BASE_URL}/customer/:customer_id',
headers: { }
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
PHP - CURL
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'BASE_URL}/customer/:customer_id',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'DELETE',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Python Requests
import requests
url = "BASE_URL}/customer/:customer_id"
payload={}
headers = {}
response = requests.request("DELETE", url, headers=headers, data=payload)
print(response.text)
Go Native
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "BASE_URL}/customer/:customer_id"
method := "DELETE"
client := &http.Client {
}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
}
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
Java Unirest
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.delete("BASE_URL}/customer/:customer_id")
.asString();
Last modified 10mo ago