AngularJS http sending post request fails

后端 未结 2 1745
广开言路
广开言路 2021-01-26 05:30

Having this GET request, it works (sends request to the sever and server is able to handle it):

    /* post to server*/
    $http.get(\"/forms/FormValidator1/val         


        
2条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-26 05:37

    I've came up with an answer related to playframework, which fixes my/this issue.

    Here it is: Playframework handling post request

    See UPDATE 2 section there.

    The point is:

    1. On Angualar side: No need to use params at all while building url. Just general approach with data
    2. And on server side use Play' bodyParser to extract data, whatever was passed as a body of request.

提交回复
热议问题