41.37 MAKE_REST_REQUEST Procedure Signature 2

This procedure performs the actual REST request (HTTP). It uses apex_web_service. All parameters for apex_web_service.make_rest_request are derived from the REST Data Source meta data passed in as p_web_source_operation.


    p_web_source_operation IN            apex_plugin.t_web_source_operation,
    p_request_body         IN            CLOB DEFAULT NULL,
    p_response             IN OUT NOCOPY CLOB,
    p_response_parameters  IN OUT NOCOPY apex_plugin.t_web_source_parameters );


Table 41-53 MAKE_REST_REQUEST Parameters

Parameter Description
p_web_source_operation Plug-in meta data for the REST Data Source operation.
p_bypass_cache If TRUE, then the cache is not used.
p_request_body Override request body to use.


Table 41-54 MAKE_REST_REQUEST Returns

Parameter Description
p_response Received response of the HTTP invocation.
p_response_parameters Received response headers and cookies, based on REST Data Source meta data.


The following example demonstrates a simplified Plug-In "fetch" procedure doing a HTTP request with APEX_PLUGIN_UTIL.MAKE_REST_REQUEST.

apex_plugin_util.make_rest_request (
    p_plugin     in            apex_plugin.t_plugin,
    p_web_source in            apex_plugin.t_web_source,
    p_params     in            apex_plugin.t_web_source_fetch_params,
    p_result     in out nocopy apex_plugin.t_web_source_fetch_result )
    l_web_source_operation apex_plugin.t_web_source_operation;

    l_web_source_operation := apex_plugin_util.get_web_source_operation(
        p_web_source   => p_web_source,
        p_db_operation => apex_plugin.c_db_operation_fetch_rows,
        p_perform_init => true );

    p_result.responses.extend( 1 );

        p_web_source_operation => l_web_source_operation,
        p_response             => p_result.responses( 1 ),
        p_response_parameters  => p_result.out_parameters );

END plugin_fetch;