机动车合格证二维码识别
在线测试
代码调用
python
import requests
url = "http://123.56.191.160:7000/service?token=3e2b020812804339be4627c29e731fc4"
payload = "ZCCCHGZ_V3.1 141030#1088|C206A00123194EDE5725C075XXXXXXXXXXXXXXXXXXXXXXXX"
headers = {
'Content-Type': 'text/plain'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
C#
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "http://123.56.191.160:7000/service?token=3e2b020812804339be4627c29e731fc4");
var content = new StringContent("ZCCCHGZ_V3.1 141030#1088|C206A00123194EDE5725C075D61A2776E85A78002BDD36875D46EAE54XXXXXXXXXX", null, "text/plain");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
JAVA
OkHttpClient client = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "ZCCCHGZ_V3.1 141030#1088|C206A00123194EDE5725C075D61A2776E85A78002BDD36875D46EXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
Request request = new Request.Builder()
.url("http://123.56.191.160:7000/service?token=3e2b020812804339be4627c29e731fc4")
.method("POST", body)
.addHeader("Content-Type", "text/plain")
.build();
Response response = client.newCall(request).execute();
NodeJs
var request = require('request');
var options = {
'method': 'POST',
'url': 'http://123.56.191.160:7000/service?token=3e2b020812804339be4627c29e731fc4',
'headers': {
'Content-Type': 'text/plain'
},
body: 'ZCCCHGZ_V3.1 141030#1088|C206A00123194EDE5725C075D61A2776E85A78002BDD36XXXXXXXXXXXXX'
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
标签:text,request,合格证,Content,二维码,var,new,识别,response
From: https://www.cnblogs.com/taxhelper/p/17883539.html