Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Data Interfaces and Communication Interfaces →  ICF - Internet Communication Framework →  ICF Examples 

Calling an HTTP Service Using the POST Method

This example demonstrates calls of an HTTP service in ICF and a Web browser. The input data is passed using the POST method.

Other versions: 7.31 | 7.40 | 7.54

Source Code

    IF icf_node IS INITIAL.
      RETURN.
    ENDIF.

    DATA(url) = icf_node &&
                `?sap-client=` && sy-mandt &&
                `&sap-language=`
                  && cl_i18n_languages=>sap1_to_sap2( sy-langu ).

    cl_demo_output=>display_html(
      |<html>| &&
      |<body>| &&
      |Link to HTTP-Service:

| &&
      |<a href="{ url }" target="_blank">{ url }</a>| &&
      |</body>| &&
      |</html>| ).

Description

This example has the same structure as the example Calling an HTTP Service. In this case, the method IF_HTTP_EXTENSION~HANDLE_REQUEST of the class CL_HTTP_EXT_SERVICE_POST_DEMO is used to demonstrate how user input sent by a HTML page form generated by the handler class is sent using the POST method and read using the method GET_CDATA.


Note

The HTTP service must be activated in transaction SICF before the example can work.