on 2024 Dec 23 10:05 PM
Hi experts,
Im consumin an api in my abap code. but it resulting in dump "http communicaiton failure". while i debugged the program i found it gives dump at receive methode call. need steps to resolve it asap, code is attached. thanks in advance.
TRY.
data(lv_url) = |http://******|. " here is my url
data: o_client type ref to if_http_client.
cl_http_client=>CREATE_BY_URL( EXPORTING
URL = lv_url
IMPORTING
client = o_client
EXCEPTIONS
ARGUMENT_NOT_FOUND = 1
PLUGIN_NOT_ACTIVE = 2
INTERNAL_ERROR = 3 ).
if sy-subrc <> 0.
o_client->CLOSE( ).
endif.
if o_client is bound.
o_client->REQUEST->SET_METHOD( if_http_request=>CO_REQUEST_METHOD_POST ).
o_client->REQUEST->SET_CONTENT_TYPE( 'application/json' ).
* Set Item Details - Ended
/UI2/CL_JSON=>SERIALIZE(
EXPORTING
DATA = IT_DATA " Data to serialize
PRETTY_NAME = /UI2/CL_JSON=>PRETTY_MODE-CAMEL_CASE
RECEIVING
R_JSON = GV_JSON ). " JSON string
o_client->REQUEST->SET_CDATA( GV_JSON ).
o_client->SEND( timeout = if_http_client=>co_timeout_default ).
o_client->RECEIVE( ).
data: lv_http_Status type i,
lv_status_text type string.
o_client->RESPONSE->GET_STATUS(
IMPORTING
code = lv_http_status
reason = lv_status_text ).
write: lv_status_text.
endif.
CATCH cx_root into data(lv_text) .
ENDTRY.
Request clarification before answering.
| User | Count |
|---|---|
| 18 | |
| 7 | |
| 6 | |
| 6 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.