表单数据请求标头格式错误

时间:2019-12-27 18:04:20

标签: reactjs http

我有这个http get请求,它将一些数据发送到本地服务器。在开发工具中,我看到以下内容: image格式错误,服务器无法正确读取。正确的是:

  

全名:乔治
      电话:xxxxxx

我该怎么办?

  const form = new FormData();
    form.append("fullname","george");
    form.append("phone","xxxxxx");
    fetch('http://localhost:3000/', {
      method: 'post',
      headers: {'Content-Type':'application/x-www-form-urlencoded'},
      body: form
    }).then((res)=>{

        console.log(res)

    });

0 个答案:

没有答案