标题: 感觉还是搜狗拿来当图床最爽了
时间: 2018-06-20发布,2018-06-20修改
『回复列表(13|隐藏机器人聊天)』
<?php
$request = new HttpRequest();
$request->setUrl('http://pic.sogou.com/pic/upload_pic.jsp');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'postman-token' => 'f586f153-4b94-f4f0-c6e9-b7183a3feb2b',
'cache-control' => 'no-cache',
'content-type' => 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW'
));
$request->setBody('------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="Content-Disposition: form-data; name="pic_path"; filename="下载.png"
Content-Type: image/png"; filename="下载.png"
Content-Type: image/png
------WebKitFormBoundary7MA4YWxkTrZu0gW--');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
var form = new FormData();
form.append("Content-Disposition: form-data; name=\"pic_path\"; filename=\"下载.png\"\nContent-Type: image/png", "微信图片_20180619134812.jpg");
var settings = {
"async": true,
"crossDomain": true,
"url": "http://pic.sogou.com/pic/upload_pic.jsp",
"method": "POST",
"headers": {
"cache-control": "no-cache",
"postman-token": "9974fe80-7e2e-21b3-6a90-cb90943f43a5"
},
"processData": false,
"contentType": false,
"mimeType": "multipart/form-data",
"data": form
}
$.ajax(settings).done(function (response) {
console.log(response);
});