mirror of
https://github.com/abapGit/abapGit.git
synced 2025-05-01 12:20:51 +08:00
New user exit create_http_client
With this commit one can implement the new user exit method create_http_client for custom http client instantiation. E.g. to use RFC destinations.
This commit is contained in:
parent
491306ff41
commit
fbc4896d65
|
@ -36,7 +36,7 @@ ENDCLASS.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CLASS ZCL_ABAPGIT_HTTP IMPLEMENTATION.
|
CLASS zcl_abapgit_http IMPLEMENTATION.
|
||||||
|
|
||||||
|
|
||||||
METHOD acquire_login_details.
|
METHOD acquire_login_details.
|
||||||
|
@ -124,6 +124,10 @@ CLASS ZCL_ABAPGIT_HTTP IMPLEMENTATION.
|
||||||
|
|
||||||
CREATE OBJECT lo_proxy_configuration.
|
CREATE OBJECT lo_proxy_configuration.
|
||||||
|
|
||||||
|
li_client = zcl_abapgit_exit=>get_instance( )->create_http_client( iv_url ).
|
||||||
|
|
||||||
|
IF li_client IS NOT BOUND.
|
||||||
|
|
||||||
cl_http_client=>create_by_url(
|
cl_http_client=>create_by_url(
|
||||||
EXPORTING
|
EXPORTING
|
||||||
url = zcl_abapgit_url=>host( iv_url )
|
url = zcl_abapgit_url=>host( iv_url )
|
||||||
|
@ -150,6 +154,8 @@ CLASS ZCL_ABAPGIT_HTTP IMPLEMENTATION.
|
||||||
zcx_abapgit_exception=>raise( lv_text ).
|
zcx_abapgit_exception=>raise( lv_text ).
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
||||||
|
ENDIF.
|
||||||
|
|
||||||
IF lo_proxy_configuration->get_proxy_authentication( iv_url ) = abap_true.
|
IF lo_proxy_configuration->get_proxy_authentication( iv_url ) = abap_true.
|
||||||
zcl_abapgit_proxy_auth=>run( li_client ).
|
zcl_abapgit_proxy_auth=>run( li_client ).
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
|
@ -93,6 +93,16 @@ CLASS zcl_abapgit_exit IMPLEMENTATION.
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
|
METHOD zif_abapgit_exit~create_http_client.
|
||||||
|
|
||||||
|
TRY.
|
||||||
|
ri_client = gi_exit->create_http_client( iv_url ).
|
||||||
|
CATCH cx_sy_ref_is_initial cx_sy_dyn_call_illegal_method.
|
||||||
|
ENDTRY.
|
||||||
|
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
METHOD zif_abapgit_exit~http_client.
|
METHOD zif_abapgit_exit~http_client.
|
||||||
|
|
||||||
TRY.
|
TRY.
|
||||||
|
|
|
@ -17,6 +17,13 @@ INTERFACE zif_abapgit_exit PUBLIC.
|
||||||
change_proxy_authentication
|
change_proxy_authentication
|
||||||
IMPORTING iv_repo_url TYPE csequence
|
IMPORTING iv_repo_url TYPE csequence
|
||||||
CHANGING cv_proxy_authentication TYPE abap_bool,
|
CHANGING cv_proxy_authentication TYPE abap_bool,
|
||||||
|
create_http_client
|
||||||
|
IMPORTING
|
||||||
|
iv_url TYPE string
|
||||||
|
RETURNING
|
||||||
|
VALUE(ri_client) TYPE REF TO if_http_client
|
||||||
|
RAISING
|
||||||
|
zcx_abapgit_exception,
|
||||||
http_client
|
http_client
|
||||||
IMPORTING
|
IMPORTING
|
||||||
ii_client TYPE REF TO if_http_client,
|
ii_client TYPE REF TO if_http_client,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user