search = new URLSearchParams(params).toString(); fetch(url,{body: payload }); // 同上 fetch(url.toString(),{body: payload }); GET /sl.se?lat=35.696233&long=139.570431 HTTP/1.1 /r/n/r/n //payload { "key0":"val0", "key1":"val1" } 当然也可以手动拼query String…… 注意,这个...
toString(); fetch(url,{body: payload }); // 同上 fetch(url.toString(),{body: payload }); GET /sl.se?lat=35.696233&long=139.570431 HTTP/1.1 /r/n/r/n //payload { "key0":"val0", "key1":"val1" } 当然也可以手动拼query String…… 注意,这个URLSearchParams不支持 IE,IE 所有版本...
search = new URLSearchParams(params).toString(); fetch(url,{body: payload }); // 同上 fetch(url.toString(),{body: payload }); GET /sl.se?lat=35.696233&long=139.570431 HTTP/1.1 /r/n/r/n //payload { "key0":"val0", "key1":"val1" } 当然也可以手动拼query String…… 注意,这个...