Post 请求地址为:
const postData = {参数}
const res = await this.requestService
.post(endpoint, stringify({ param: JSON.stringify(postData) }), {
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
})
.catch((e) => {
throw new Error(e.message);
});
get 请求地址为:
const endpoint = `${this.host}/getOrderTrackingNumber.htm`;
const res = await this.requestService
.post(
endpoint,
stringify({ param: JSON.stringify({ documentCode: orderId }) }),
{
headers: {
'content-type': 'application/x-www-form-urlencoded',
},
},
)
.catch((e) => {
throw new Error(e.message);
});