我正在使用 fetch 发布一些 url 编码的表单数据,如下所示:
private buy = async () => {
const { nonce } = await this.state.instance.requestPaymentMethod();
const formBody = [];
formBody.push(`${encodeURIComponent("paymentMethodNonce")}=${encodeURIComponent(nonce)}`);
// @ts-ignore
const response = await fetch(`http://localhost:4000/checkout`, {
method: "post",
headers: {
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
},
body: formBody,
});
}
它适用于忽略,但在这种情况下我应该使用什么类型才能删除忽略?