Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-8991

[fiware-stackoverflow] HTTP POST request gets transformed to GET request

    Details

      Description

      Created question in FIWARE Q/A platform on 23-05-2016 at 10:05
      Please, ANSWER this question AT https://stackoverflow.com/questions/37386670/http-post-request-gets-transformed-to-get-request

      Question:
      HTTP POST request gets transformed to GET request

      Description:
      How exactly does the WireCloud proxy work? We use the following code for a request via the WireCloud proxy:

      MashupPlatform.http.makeRequest(url, {
      method: 'POST',
      forceProxy: true,
      onSuccess: function (response)

      { success(response); }

      ,
      onFailure: function (response)

      { error(response); }

      ,
      onComplete: function ()

      { complete(); }

      });

      The browser network analysis shows that a POST request gets send to https://example.com/cdp/https/rest.example.com/path/to/service. Our webservice that gets called by the url however logs, that it receives a GET request.

      The access log of our rest service hosted by a tomcat shows:

      192.168.60.221 - - [26/May/2016:10:38:31 +0200] "GET /path/to/service HTTP/1.1" 405 1013
      192.168.60.221 - - [26/May/2016:10:38:42 +0200] "POST /path/to/service HTTP/1.1" 204 -

      The first call is done with the MashupPlatform.http.makeRequest call listed above, the second call is done with jQuery like this:

      $.ajax(

      { type: "POST", url: url, data: null, success: success }

      );

      This works perfeclty fine when we set the CORS header in our webservice.

      So what may be the reason, that WireClouds proxy does not work as expected?

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        2h 55m 1 Backlog Manager 22/May/17 6:08 PM
        In Progress In Progress Closed Closed
        3h 1 Backlog Manager 22/May/17 9:08 PM
        fla Fernando Lopez made changes -
        Fix Version/s 2021 [ 12600 ]
        fla Fernando Lopez made changes -
        Assignee Backlog Manager [ backlogmanager ]
        fla Fernando Lopez made changes -
        HD-Enabler Wirecloud [ 10857 ]
        Description
        Created question in FIWARE Q/A platform on 23-05-2016 at 10:05
        {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/37386670/http-post-request-gets-transformed-to-get-request


        +Question:+
        HTTP POST request gets transformed to GET request

        +Description:+
        How exactly does the WireCloud proxy work? We use the following code for a request via the WireCloud proxy:

        MashupPlatform.http.makeRequest(url, {
                method: 'POST',
                forceProxy: true,
                onSuccess: function (response) {
                    success(response);
                },
                onFailure: function (response) {
                    error(response);
                },
                onComplete: function () {
                    complete();
                }
            });


        The browser network analysis shows that a POST request gets send to https://example.com/cdp/https/rest.example.com/path/to/service. Our webservice that gets called by the url however logs, that it receives a GET request.

        The access log of our rest service hosted by a tomcat shows:

        192.168.60.221 - - [26/May/2016:10:38:31 +0200] "GET /path/to/service HTTP/1.1" 405 1013
        192.168.60.221 - - [26/May/2016:10:38:42 +0200] "POST /path/to/service HTTP/1.1" 204 -


        The first call is done with the MashupPlatform.http.makeRequest call listed above, the second call is done with jQuery like this:

        $.ajax({
                type: "POST",
                url: url,
                data: null,
                success: success
            });


        This works perfeclty fine when we set the CORS header in our webservice.

        So what may be the reason, that WireClouds proxy does not work as expected?
        Created question in FIWARE Q/A platform on 23-05-2016 at 10:05
        {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/37386670/http-post-request-gets-transformed-to-get-request


        +Question:+
        HTTP POST request gets transformed to GET request

        +Description:+
        How exactly does the WireCloud proxy work? We use the following code for a request via the WireCloud proxy:

        MashupPlatform.http.makeRequest(url, {
                method: 'POST',
                forceProxy: true,
                onSuccess: function (response) {
                    success(response);
                },
                onFailure: function (response) {
                    error(response);
                },
                onComplete: function () {
                    complete();
                }
            });


        The browser network analysis shows that a POST request gets send to https://example.com/cdp/https/rest.example.com/path/to/service. Our webservice that gets called by the url however logs, that it receives a GET request.

        The access log of our rest service hosted by a tomcat shows:

        192.168.60.221 - - [26/May/2016:10:38:31 +0200] "GET /path/to/service HTTP/1.1" 405 1013
        192.168.60.221 - - [26/May/2016:10:38:42 +0200] "POST /path/to/service HTTP/1.1" 204 -


        The first call is done with the MashupPlatform.http.makeRequest call listed above, the second call is done with jQuery like this:

        $.ajax({
                type: "POST",
                url: url,
                data: null,
                success: success
            });


        This works perfeclty fine when we set the CORS header in our webservice.

        So what may be the reason, that WireClouds proxy does not work as expected?
        Hide
        backlogmanager Backlog Manager added a comment -

        2017-05-22 21:10|UPDATED status: transition Finish| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2017-05-22 21:10|UPDATED status: transition Finish| # answers= 1, accepted answer= True
        backlogmanager Backlog Manager made changes -
        Resolution Done [ 10000 ]
        Status In Progress [ 3 ] Closed [ 6 ]
        Hide
        backlogmanager Backlog Manager added a comment -

        2017-05-22 18:10|UPDATED status: transition Answer| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2017-05-22 18:10|UPDATED status: transition Answer| # answers= 1, accepted answer= True
        backlogmanager Backlog Manager made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        backlogmanager Backlog Manager made changes -
        Field Original Value New Value
        Component/s FIWARE-TECH-HELP [ 10278 ]
        Hide
        backlogmanager Backlog Manager added a comment -

        2017-05-22 15:14|CREATED monitor | # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2017-05-22 15:14|CREATED monitor | # answers= 1, accepted answer= True
        backlogmanager Backlog Manager created issue -

          People

          • Assignee:
            backlogmanager Backlog Manager
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: