{ "status": 0, "charge": false, "remain": 97, "msg": "查询成功", "result": { "code": 0, "msg": "Accept", "processTimeInMs": 552, "timestamp": 1576729150797, "faceItems": [{ "blurScore": 0.01, "boundingBox": { "height": 559.81, "left": 375.71, "top": 109.00, "width": 406.53 }, "isValidPosture": true, "posture": { "pitch": -9.99, "roll": -1.56, "yaw": 13.43 } }, { "blurScore": 0.00, "boundingBox": { "height": 554.01, "left": 849.03, "top": 98.94, "width": 392.19 }, "isValidPosture": true, "posture": { "pitch": -10.72, "roll": 0.68, "yaw": -1.38 } } ], "faceMatches": [{ "createTime": "1576808089949", "customInfo": "45464", "faceId": "5dfc2e998788724bae434395", "groupId": "5df8c5ae87887252653b3cec", "imgBase64": "/9j/4AAQSkZJRgAB...", "score": 0.96, "updateTime": "1576808123367" }] } }
<?php /** * Created by PhpStorm. * User: FZS * Time: 2021/03/27 15:26 */ class freeApi { private $apiUrl; public function __construct() { $this->apiUrl = 'https://way.jd.com/JDAI/detectHacknessV1?appkey=key&body={ "imageBase64": "iVBORw0K...", "topN": 5, "groupId": "5de9ff3087887242172ce62d" }'; } /** * 获取结果 * @return array */ public function getResult() { return file_get_contents($this->apiUrl); } }
package main import ( "fmt" "io/ioutil" "log" "net/http" ) const ( APIURL = "https://way.jd.com/JDAI/detectHacknessV1?appkey=key&body={ "imageBase64": "iVBORw0K...", "topN": 5, "groupId": "5de9ff3087887242172ce62d" }" ) func main() { queryUrl := fmt.Sprintf("%s",APIURL) resp, err := http.Get(queryUrl) if err != nil { log.Println(err) return } defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) }