https://api.ysykj.icu/API/test_demo.php
返回格式:
application/json
请求方式:
GET
请求示例:
https://api.ysykj.icu/API/test_demo.php
请求HEADER:
| 名称 | 值 |
| Content-Type | application/x-www-form-urlencoded;charset=utf-8 |
请求参数说明:
| 名称 | 必填 | 类型 | 示例值 | 说明 |
| name |
否 |
string |
API |
名称参数 |
| type |
否 |
string |
test |
类型参数 |
返回参数说明:
返回示例:
{}
<?php
$url = 'https://api.ysykj.icu/API/test_demo.php';
$params = [
'name' => 'YOUR_VALUE',
'type' => 'YOUR_VALUE',
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
const url = 'https://api.ysykj.icu/API/test_demo.php';
const params = new URLSearchParams({
'name': 'YOUR_VALUE',
'type': 'YOUR_VALUE',
});
fetch(url, {
method: 'GET',
body: params
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
import requests
url = 'https://api.ysykj.icu/API/test_demo.php'
params = {
'name': 'YOUR_VALUE',
'type': 'YOUR_VALUE',
}
response = requests.post(url, data=params)
print(response.json())
import java.net.*;
import java.io.*;
public class Main {
public static void main(String[] args) throws Exception {
URL url = new URL("https://api.ysykj.icu/API/test_demo.php");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
conn.setDoOutput(true);
String params = "name=YOUR_VALUE&type=YOUR_VALUE";
OutputStream os = conn.getOutputStream();
os.write(params.getBytes());
os.flush();
BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String line;
while ((line = br.readLine()) != null) {
System.out.println(line);
}
br.close();
}
}
package main
import (
"fmt"
"net/http"
"net/url"
)
func main() {
formData := url.Values{}
formData.Set("name", "YOUR_VALUE")
formData.Set("type", "YOUR_VALUE")
resp, err := http.PostForm("https://api.ysykj.icu/API/test_demo.php", formData)
if err != nil {
fmt.Println(err)
return
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
const http = require('http');
const querystring = require('querystring');
const params = querystring.stringify({
'name': 'YOUR_VALUE',
'type': 'YOUR_VALUE',
});
const options = {
hostname: 'api.ysykj.icu',
path: '/API/test_demo.php',
method: 'GET',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': Buffer.byteLength(params)
}
};
const req = http.request(options, res => {
let data = '';
res.on('data', chunk => { data += chunk; });
res.on('end', () => { console.log(data); });
});
req.write(params);
req.end();
#include <iostream>
#include <curl/curl.h>
int main() {
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "https://api.ysykj.icu/API/test_demo.php");
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "name=YOUR_VALUE&type=YOUR_VALUE");
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
return 0;
}
using System;
using System.Net;
using System.IO;
class Program {
static void Main() {
WebClient client = new WebClient();
client.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
string postData = "name=YOUR_VALUE&type=YOUR_VALUE";
string response = client.UploadString("https://api.ysykj.icu/API/test_demo.php", postData);
Console.WriteLine(response);
}
}
Imports System.Net
Imports System.IO
Module Module1
Sub Main()
Dim client As New WebClient()
client.Headers(HttpRequestHeader.ContentType) = "application/x-www-form-urlencoded"
Dim postData As String = "name=YOUR_VALUE&type=YOUR_VALUE"
Dim response As String = client.UploadString("https://api.ysykj.icu/API/test_demo.php", postData)
Console.WriteLine(response)
End Sub
End Module