curl -X POST \
http://api.toolfk.com/api/clang \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'token=用户中心获取&content=%E4%B8%AD%E6%96%87%E5%B7%A5%E5%85%B7%E5%8C%85%EF%BC%8C%E6%94%AF%E6%8C%81%E6%B1%89%E5%AD%97%E8%BD%AC%E6%8B%BC%E9%9F%B3%E3%80%81%E6%8B%BC%E9%9F%B3%E5%88%86%E8%AF%8D%E3%80%81%E7%AE%80%E7%B9%81%E4%BA%92%E8%BD%AC%E3%80%81%E6%95%B0%E5%AD%97%E3%80%81%E9%87%91%E9%A2%9D%E5%A4%A7%E5%86%99&type=1'
//记得去掉这个 "\" 斜线
<\?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "http://api.toolfk.com/api/clang",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "token=用户中心获取&content=%E4%B8%AD%E6%96%87%E5%B7%A5%E5%85%B7%E5%8C%85%EF%BC%8C%E6%94%AF%E6%8C%81%E6%B1%89%E5%AD%97%E8%BD%AC%E6%8B%BC%E9%9F%B3%E3%80%81%E6%8B%BC%E9%9F%B3%E5%88%86%E8%AF%8D%E3%80%81%E7%AE%80%E7%B9%81%E4%BA%92%E8%BD%AC%E3%80%81%E6%95%B0%E5%AD%97%E3%80%81%E9%87%91%E9%A2%9D%E5%A4%A7%E5%86%99&type=1",
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;
}
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "token=用户中心获取&content=%E4%B8%AD%E6%96%87%E5%B7%A5%E5%85%B7%E5%8C%85%EF%BC%8C%E6%94%AF%E6%8C%81%E6%B1%89%E5%AD%97%E8%BD%AC%E6%8B%BC%E9%9F%B3%E3%80%81%E6%8B%BC%E9%9F%B3%E5%88%86%E8%AF%8D%E3%80%81%E7%AE%80%E7%B9%81%E4%BA%92%E8%BD%AC%E3%80%81%E6%95%B0%E5%AD%97%E3%80%81%E9%87%91%E9%A2%9D%E5%A4%A7%E5%86%99&type=1");
Request request = new Request.Builder()
.url("http://api.toolfk.com/api/clang")
.post(body)
.addHeader("Content-Type", "application/x-www-form-urlencoded")
.build();
Response response = client.newCall(request).execute();
import requests
url = "http://api.toolfk.com/api/clang"
payload = "token=用户中心获取&content=%E4%B8%AD%E6%96%87%E5%B7%A5%E5%85%B7%E5%8C%85%EF%BC%8C%E6%94%AF%E6%8C%81%E6%B1%89%E5%AD%97%E8%BD%AC%E6%8B%BC%E9%9F%B3%E3%80%81%E6%8B%BC%E9%9F%B3%E5%88%86%E8%AF%8D%E3%80%81%E7%AE%80%E7%B9%81%E4%BA%92%E8%BD%AC%E3%80%81%E6%95%B0%E5%AD%97%E3%80%81%E9%87%91%E9%A2%9D%E5%A4%A7%E5%86%99&type=1"
headers = {'Content-Type': "application/x-www-form-urlencoded"}
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text)
var data = "token=用户中心获取&content=%E4%B8%AD%E6%96%87%E5%B7%A5%E5%85%B7%E5%8C%85%EF%BC%8C%E6%94%AF%E6%8C%81%E6%B1%89%E5%AD%97%E8%BD%AC%E6%8B%BC%E9%9F%B3%E3%80%81%E6%8B%BC%E9%9F%B3%E5%88%86%E8%AF%8D%E3%80%81%E7%AE%80%E7%B9%81%E4%BA%92%E8%BD%AC%E3%80%81%E6%95%B0%E5%AD%97%E3%80%81%E9%87%91%E9%A2%9D%E5%A4%A7%E5%86%99&type=1";
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "http://api.toolfk.com/api/clang");
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send(data);
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "http://api.toolfk.com/api/clang"
payload := strings.NewReader("token=用户中心获取&content=%E4%B8%AD%E6%96%87%E5%B7%A5%E5%85%B7%E5%8C%85%EF%BC%8C%E6%94%AF%E6%8C%81%E6%B1%89%E5%AD%97%E8%BD%AC%E6%8B%BC%E9%9F%B3%E3%80%81%E6%8B%BC%E9%9F%B3%E5%88%86%E8%AF%8D%E3%80%81%E7%AE%80%E7%B9%81%E4%BA%92%E8%BD%AC%E3%80%81%E6%95%B0%E5%AD%97%E3%80%81%E9%87%91%E9%A2%9D%E5%A4%A7%E5%86%99&type=1")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
async res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "http://api.toolfk.com/api/clang"
payload := strings.NewReader("{
"token": "用户中心获取token",
"type": "a",
"format": "json"
}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
async res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}