Considerations When Using HTTP Methods: GET and POST

Throughout this content, each WebFOCUS RESTful Web Service request that is documented indicates a specific HTTP method to use. This section describes several considerations that developers need to be aware of when using WebFOCUS RESTful Web Service requests with GET and POST HTTP methods.

  • If the method indicated is GET, then a GET or a POST may be used. If the method indicated is POST, then only a POST may be used.
  • If the WebFOCUS RESTful Web Service request uses a GET method, but the action is not allowed to be a GET, then the following error is generated:
    ERROR_INVALID_HTTP_REQUEST_TYPE
    Note: The RESTful Webservices Method Enforcement parameter, which can be active or inactive, controls this behavior. This parameter is located in the WebFOCUS Administration Console (under Application Settings, Filters), as shown in the following image.

  • Before you use the POST method, you need to determine if the environment you are working in is accessing WebFOCUS from different web hosts, which is referred to as a cross-origin scenario. If so, then you must configure Cross-Origin Request Sharing (CORS) features and Cross-Site Request Forgery (CSRF) functionality in WebFOCUS.
    • For more information on configuring and using cross-origin settings in WebFOCUS, see the WebFOCUS Security and Administration content.
    • For more information on configuring CSRF functionality, see Cross-Site Request Forgery (CSRF).
  • The GET method has a limitation related to the amount of data that can be sent in a query. If you need to run a report containing a large amount of parameter data (for example, approximately 2000 bytes or 4000 in some cases), then you may need to use a POST method as an alternative.