Delete an existing user⁠

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "/api/v1/users/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}
URL obj = new URL("/api/v1/users/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());
const headers = {
  'Authorization':'Bearer {access-token}'
};

fetch('/api/v1/users/{id}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
import requests
headers = {
  'Authorization': 'Bearer {access-token}'
}

r = requests.delete('/api/v1/users/{id}', headers = headers)

print(r.json())
require 'rest-client'
require 'json'

headers = {
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.delete '/api/v1/users/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

DELETE /api/v1/users/{id}

Delete an existing user.

Parameters⁠

Name

In

Type

Required

Description

id

path

string

true

none

Responses⁠

Status

Meaning

Description

Schema

204

No Content

No Content

None

To perform this operation, you must be authenticated by means of one of the following methods: oauth