How do you POST a FormData object in Angular 2?

前端 未结 4 1872
隐瞒了意图╮
隐瞒了意图╮ 2020-12-07 22:27

I need to upload a file and send some json along with it, I have this function:

POST_formData(url, data) {
        var headers = new Headers(), authtoken = l         


        
4条回答
  •  失恋的感觉
    2020-12-07 23:22

    I solved this problem, don't need content-type at all.

    See here, https://stackoverflow.com/a/45879409/2803344

    Also see here to check how to set headers, Angular2 - set headers for every request

    2017.8.25

提交回复
热议问题