Field | Type | Description |
error | string | Error, which indicates a failed request if not left blank. |
response | Request result. |
import http from 'pts/http';export default function () {const responses = http.batch([{method: 'GET',url: 'http://httpbin.org/get?a=1',headers: { a: '1, 2, 3' },query: { b: '2' },}{method: 'GET',url: 'http://httpbin.org/get?a=1',headers: { a: '1, 2, 3' },query: { b: '2' },}]{parallel: 1,});// 200 OK// 200 OKfor (const resp of responses) {console.log(resp.response.status);}}
Feedback