escape_urlEXPORTINGunescaped=contentRECEIVINGe" />
【ABAP】SAP调用Restful传输地址中文解决方法 您所在的位置:网站首页 restful的接口方法 【ABAP】SAP调用Restful传输地址中文解决方法

【ABAP】SAP调用Restful传输地址中文解决方法

2023-03-13 20:12| 来源: 网络整理| 查看: 265

restful传输不需要建企业服务客户端代理,直接代码传输即可,中文需要转码

" 中文转ASCII CALL METHOD cl_http_utility=>escape_url EXPORTING unescaped = content RECEIVING escaped = content. 123456

其余步骤如下

"创建http客户端 CALL METHOD cl_http_client=>create_by_url EXPORTING url = url IMPORTING client = http_client EXCEPTIONS argument_not_found = 1 plugin_not_active = 2 internal_error = 3 OTHERS = 4.

"设置http method 为Get http_client->request->set_method( if_http_request=>co_request_method_get ).

"发送 CALL METHOD http_client->send EXCEPTIONS http_communication_failure = 1 http_invalid_state = 2 http_processing_failed = 3 http_invalid_timeout = 4 OTHERS = 5.

"接收 CALL METHOD http_client->receive EXCEPTIONS http_communication_failure = 1 http_invalid_state = 2 http_processing_failed = 3.

"获取接口返回的数据 result = http_client->response->get_cdata( ).



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有