Angularjs sent post request times 415 error.

  node.js, question

Nodejs forwards the background post interface, while the foreground angularjs is responsible for sending it. It is found that no matter how to set the headers,content-type and $http services, the browser will report 415 error, saying it is Unsupported Media Type. How can Daniel answer?

This problem has been solved:
415 error should be a content-type problem, but angularjs supports PostContent Type = “Application/JSON” by default. The reason for this problem is that Apigee Edge and APIGEE act as a bridge between web service providers and APP developers, providing relatively stable interfaces for both parties to connect, making the development process of developers more unified and consistent, and improving development efficiency. Make APP of service provider easier to manage; Angular appeared 415 when sending post request to the background because there is no grant type configured for web and server connection in http. To a generateaccesstoken endpoint on apigeedge.if the credentials arevalid, edgereturns an accesstoken to the clientapp.reference:http://apigee.com/docs/api-services/content/oauth-20-client-credential …
400: The error is that RequestBody is not configured, and the parameter configuration is incorrect.
All this problem should be matched with the following parameters in the angular http service:
data: {‘grant_type’: ‘client_credentials’},
data: { ‘Id’: ’11’ }
The problem is solved! I hope it will be useful to everyone. …