Skip to content

Commit

Permalink
cleanup handler
Browse files Browse the repository at this point in the history
  • Loading branch information
oblomov-dev authored Sep 8, 2024
1 parent 19ee93f commit b50a7ee
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions test/zcl_sicf.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,15 @@ CLASS zcl_sicf IMPLEMENTATION.
METHOD if_http_extension~handle_request.

DATA lv_requ_body TYPE string.
DATA lv_method TYPE string.

lv_requ_body = server->request->get_cdata( ).
lv_method = server->request->get_method( ).
lv_req = server->request->get_cdata( ).

DATA lv_resp TYPE string.
CASE lv_method.
WHEN 'GET'.
lv_resp = z2ui5_cl_http_handler=>http_get( ).
WHEN 'POST'.
lv_resp = z2ui5_cl_http_handler=>http_post( lv_requ_body ).
ENDCASE.
lv_resp = z2ui5_cl_http_handler=>main( lv_req ).

server->response->set_cdata( lv_resp ).
server->response->set_header_field( name = `cache-control` value = `no-cache` ).
server->response->set_status( code = 200 reason = `success` ).

ENDMETHOD.

ENDCLASS.
ENDCLASS.

0 comments on commit b50a7ee

Please sign in to comment.