删除已禁用渠道

👨‍💼 需要管理员权限(Admin)

DELETE/api/channel/disabled

删除已禁用渠道

👨‍💼 需要管理员权限(Admin)

示例代码

curl -X DELETE "https://api.nodeprice.com/api/channel/disabled" \
  -H "Authorization: Bearer <token>"
const url = "https://api.nodeprice.com/api/channel/disabled";

const response = await fetch(url, {
  method: "DELETE",
  headers: {
    "Authorization": "Bearer <token>"
  }
});

console.log(await response.text());
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	url := "https://api.nodeprice.com/api/channel/disabled"
	req, err := http.NewRequest("DELETE", url, nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Authorization", "Bearer <token>")
	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()
	data, err := io.ReadAll(resp.Body)
	if err != nil {
		panic(err)
	}
	fmt.Println(string(data))
}
import requests

url = "https://api.nodeprice.com/api/channel/disabled"

response = requests.request("DELETE", url, headers={
  "Authorization": "Bearer <token>"
})

print(response.text)
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
    .url("https://api.nodeprice.com/api/channel/disabled")
    .method("DELETE", null)
    .addHeader("Authorization", "Bearer <token>")
    .build();

Response response = client.newCall(request).execute();
System.out.println(response.body().string());
#include <stdio.h>
#include <curl/curl.h>

int main(void) {
    CURL *curl = curl_easy_init();
    if (curl == NULL) {
        return 1;
    }

    struct curl_slist *headers = NULL;
    headers = curl_slist_append(headers, "Authorization: Bearer <token>");

    curl_easy_setopt(curl, CURLOPT_URL, "https://api.nodeprice.com/api/channel/disabled");
    curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELETE");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);

    CURLcode code = curl_easy_perform(curl);
    if (code != CURLE_OK) {
        fprintf(stderr, "%s\n", curl_easy_strerror(code));
    }

    curl_slist_free_all(headers);
    curl_easy_cleanup(curl);
    return 0;
}
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var request = new HttpRequestMessage(HttpMethod.Delete, "https://api.nodeprice.com/api/channel/disabled");
        request.Headers.Add("Authorization", "Bearer <token>");

        var response = await client.SendAsync(request);
        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}

响应

200 成功