Post 'x-www-form-urlencoded' content with aurelia-fetch-client

后端 未结 2 794
眼角桃花
眼角桃花 2021-01-14 12:37

The question is simple: how do I post x-www-form-urlencoded content with Aurelia Fetch client?

I need to make the post to a simple ASP.NET Web API serve

2条回答
  •  梦谈多话
    2021-01-14 12:48

    You would use FormData like this:

    function sendForm() {
      var formData = new FormData();
      formData.append('email', 'test@test.com');
      formData.append('password', '123456');
    
      http.post(url, formData);
    }
    

提交回复
热议问题