词语造句详情API接口

在线词语造句是一部在线造句词典,其宗旨是让大家更快地造出更优质的句子.造句网尽量原创和收集优质句子,在线造句大全、在线生成句子可以随机生成10个常见简单句子,适合中文初级学习人士!

接口文档 《查看会员》
接口地址: http://api.toolfk.com/api/zhaoju-detail | 在线体验接口
请求方法: [ "GET", "POST" ]
请求参数:
名称 类型 描述 示例
token string 请求的token 用户中心获取token
title string 标题 哀兵必胜
-- 漂亮的分割符 --
返回数据:

{
    "status": 1,
    "data": {
        "id": 14,
        "title": "哀兵必胜",
        "pinyin": "āi bīng bì shèng",
        "explain": "原意是力量相当的两军对阵,悲愤的一方获得胜利。后指因受欺侮而奋起抵抗的军队,必定能取胜。 两军对垒,受压迫、处境绝望而悲愤反抗的一方必能获胜",
        "content": [
            "造句1:<i><em>哀兵必胜</em>,中国人民终于赢得了抗日战争的最后胜利。</i>",
            "造句2:<i><em>哀兵必胜</em>!苏联红军终于赶走法西斯。</i>",
            "造句3:<i>抗日战争的胜利,就是<em>哀兵必胜</em>的一个典型例证。</i>"
        ],
        "texts": [
            "造句1:哀兵必胜,中国人民终于赢得了抗日战争的最后胜利。",
            "造句2:哀兵必胜!苏联红军终于赶走法西斯。",
            "造句3:抗日战争的胜利,就是哀兵必胜的一个典型例证。"
        ]
    }
}
                
                            
代码示例:
  • Curl
  • PHP
  • Java
  • Python
  • JavaScript
  • Go
  • Nodejs

    curl -X POST \
    http://api.toolfk.com/api/zhaoju-detail \
    -H 'Content-Type: application/x-www-form-urlencoded' \
    -d 'token=用户中心获取&title=%E5%93%80%E5%85%B5%E5%BF%85%E8%83%9C'
                                       
//记得去掉这个 "\" 斜线
<\?php
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "http://api.toolfk.com/api/zhaoju-detail",
  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=用户中心获取&title=%E5%93%80%E5%85%B5%E5%BF%85%E8%83%9C",
  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=用户中心获取&title=%E5%93%80%E5%85%B5%E5%BF%85%E8%83%9C");
Request request = new Request.Builder()
  .url("http://api.toolfk.com/api/zhaoju-detail")
  .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/zhaoju-detail"

payload = "token=用户中心获取&title=%E5%93%80%E5%85%B5%E5%BF%85%E8%83%9C"
headers = {'Content-Type': "application/x-www-form-urlencoded"}

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

print(response.text)
var data = "token=用户中心获取&title=%E5%93%80%E5%85%B5%E5%BF%85%E8%83%9C";

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/zhaoju-detail");
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/zhaoju-detail"

	payload := strings.NewReader("token=用户中心获取&title=%E5%93%80%E5%85%B5%E5%BF%85%E8%83%9C")

	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/zhaoju-detail"

        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))

}
                                       
返回状态码 status 描述参照
返回码 描述
status 1:表示成功,0:表示失败
data 成功返回数据
errmsg 失败返回数据
备注:开通API接口服务,可同时享用 www.toolfk.com 网站的会员工具。