Post JSON from angular 2 to php

后端 未结 3 1040
难免孤独
难免孤独 2020-12-29 15:06

I try to post data from angular 2 to php:

let headers = new Headers();
headers.append(\'Content-Type\', \'application/json\');
var order = {\'order\': this.o         


        
3条回答
  •  爱一瞬间的悲伤
    2020-12-29 15:21

    Agreed with you that we can't at the moment provide object instead of string. It's a feature in progress. See this issue:

    • https://github.com/angular/http/issues/69

    Regarding your problem to get JSON data on the server side, this question should help you:

    • Read associative array from json in $_POST

提交回复
热议问题