Now there is a project where Party A has given an http interface as follows
1. Provide interface http access url, uniform character encoding: UTF-8.
2. http interface request content-Type="application/json".
3. The interface requests the interface url through http post and sends a body that conforms to the JSON specification.
The access key is also given, how to implement it using PHP. Thanks.
Request example:
{
"secretKey": "**********",
"stationNo": "123456789",
"msgId": "1111",
"data": {
"heatMeter": [
"{
"installAddr": "1# Heat Meter",
"readTime": ""2017-09-25 12:00:01",
"accHeat": 11.12,
"accCold": 11.13,
"accFlow": 11.14,
"accCold": 11.13,
"accFlow" ": 11.16,
"inTemp": 11.17,
"outTemp": 21.18,
"tempDiff": 10.01,
"workTime" : 12,
"Workstatus": 0,
"Heatunit": "GJ",
## "" Coldunit ":" gj ", " Powerunit ":" gj/h " ,"flowUnit": "m³", "realFlowUnit": "m³/h"
}
],
Return sample:
{
"msg": "Upload successful" //Here are the details of Chinese characters Problem Description
"msgId":"1111"
"status": 0,
}
You can also use ajax request
Use curl