Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To test this scenario, use the same setup as above, but instead of removing the data part from the request, add some query parameters to the URL as follows:

curl -v -H "Content-Type: applicationtext/xml" -d "<Customer><id>123</id><name>John</name></Customer>" 'http://localhost:8280/customerservice/customers?param1=value1¶m2value1&param2=value2'

When you execute this command, you can see the following output in tcpmon:

...

As you can see, the query parameters are present in the REST request, demonstrating that the ESB WSO2 EI sent them along with the message. You could write resource methods to support this type of a request. In this example, the resource method accessed by this request simply ignores the parameters.

...

Typically, a GET request does not contain a body, and WSO2 ESB does not support these types of requests. When it receives a GET request that contains a body, it drops the message body as it sends the message to the endpoint. YOu can test this scenario using the same setup as above, but this time the client command should look like this:

curl -v -H "Content-Type: applicationtext/xml" -d "<Customer><id>123</id><name>John</name></Customer>" 'http://localhost:8280/jaxrs_basic/services/customers/customerservice/customers/123' -X GET

The additional parameter -X replaces the original POST method with the specified method, which in this case is GET. This will cause the client to send a GET request with a message similar to a POST request. If you view the output in tcpmon, you will see that there is no message body in the request.