FecAPI使用说明

释放双眼,带上耳机,听听看~!

说明

  1. fecapi又名vpsdie,由 Inkedus 独立开发

  2. 官方文档地址:https://docs.vpsdie.com

  3. 有问题,bug 等 可以联系我,email: admin@zhuchunshu.com

  4. 如果接口数据返回成功,code 等于 200, 不为 200 都是失败

接口Url

https://api.vpsdie.com

完整请求路径为:https://api.vpsdie.com/版本/接口名/api.html

例如:https://api.vpsdie.com/v1/UserData/api.html

目前支持post,get请求

请求必选参数:uk 用户密钥

请求示例

Go

下面代码可以简单获取用户密钥为test 的FecApi用户信息

package main

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

func main() {
    url := "https://api.vpsdie.com/v1/UserData/api.html"
    payload := strings.NewReader("uk=test")
    req, _ := http.NewRequest("POST", url, payload)
    req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
    res, _ := http.DefaultClient.Do(req)
    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)
    fmt.Println(res)
    fmt.Println(string(body))

}

PHP

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.vpsdie.com/v1/UserData/api.html",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "uk=test",
  CURLOPT_HTTPHEADER => array(
    "Content-Type: application/x-www-form-urlencoded",
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

JAVA

OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "uk=test");
Request request = new Request.Builder()
  .url("https://api.vpsdie.com/v1/UserData/api.html")
  .post(body)
  .addHeader("Content-Type", "application/x-www-form-urlencoded")
  .build();

Response response = client.newCall(request).execute();

Curl

curl -X POST \
https://api.vpsdie.com/v1/UserData/api.html \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'uk=test'

JAVASCRIPT

var data = "uk=test";

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.vpsdie.com/v1/UserData/api.html");
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

xhr.send(data);

Python

import requests

url = "https://api.vpsdie.com/v1/UserData/api.html"

payload = "uk=test"
headers = {'Content-Type': "application/x-www-form-urlencoded"}

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)

用户密钥 UserKey

USERKEY又名Token,是请求接口时的必选参数,需要在fecapi控制中心申请查看

人已赞赏
PHP学习笔记技术杂烩

如何修改或删除WordPress默认主题的“自豪地采用WordPress”?

2020-11-30 21:31:31

技术杂烩网站建设

让wordpress支持用户名使用中文

2020-12-16 17:11:00

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索