<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://pay.deenxin.cn/kf/API/MSH/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "cmd=add&toKen={toKen}&pay=33&ddh={ddh}&money={money}&title={title}",
CURLOPT_HTTPHEADER => [
"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;
}
HttpResponse<String> response = Unirest.post("https://pay.deenxin.cn/kf/API/MSH/")
.header("content-type", "application/x-www-form-urlencoded")
.body("cmd=add&toKen={toKen}&pay=33&ddh={ddh}&money={money}&title={title}")
.asString();
import http.client
conn = http.client.HTTPSConnection("pay.deenxin.cn")
payload = "cmd=add&toKen={toKen}&pay=33&ddh={ddh}&money={money}&title={title}"
headers = { 'content-type': "application/x-www-form-urlencoded" }
conn.request("POST", "/kf/API/MSH/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("https://pay.deenxin.cn/kf/API/MSH/"),
Content = new FormUrlEncodedContent(new Dictionary<string, string>
{
{ "cmd", "add" },
{ "toKen", "{toKen}" },
{ "pay", "33" },
{ "ddh", "{ddh}" },
{ "money", "{money}" },
{ "title", "{title}" },
}),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://pay.deenxin.cn/kf/API/MSH/"
payload := strings.NewReader("cmd=add&toKen={toKen}&pay=33&ddh={ddh}&money={money}&title={title}")
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))
}
const data = "cmd=add&toKen={toKen}&pay=33&ddh={ddh}&money={money}&title={title}";
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://pay.deenxin.cn/kf/API/MSH/");
xhr.setRequestHeader("content-type", "application/x-www-form-urlencoded");
xhr.send(data);
const unirest = require("unirest");
const req = unirest("POST", "https://pay.deenxin.cn/kf/API/MSH/");
req.headers({
"content-type": "application/x-www-form-urlencoded"
});
req.form({
"cmd": "add",
"toKen": "{toKen}",
"pay": "33",
"ddh": "{ddh}",
"money": "{money}",
"title": "{title}"
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
library(httr)
url <- "https://pay.deenxin.cn/kf/API/MSH/"
payload <- "cmd=add&toKen={toKen}&pay=33&ddh={ddh}&money={money}&title={title}"
encode <- "form"
response <- VERB("POST", url, body = payload, content_type("application/x-www-form-urlencoded"), encode = encode)
content(response, "text")