REPORT zdemo14.
TYPES: BEGIN OF text ,
line(256),
END OF text .
DATA: gt_response TYPE TABLE OF text WITH HEADER LINE .
DATA: gt_response_header TYPE TABLE OF text WITH HEADER LINE .
DATA: g_status(3) TYPE c ,
g_statustext(128) TYPE c ,
g_length TYPE i .
PARAMETERS: p_url(100) TYPE c LOWER CASE DEFAULT 'http://blog.chinaunix.net/uid-69974615-id-5838870.html'.
PARAMETERS: p_dest LIKE rfcdes-rfcdest DEFAULT 'SAPHTTP'.
CALL FUNCTION 'HTTP_GET'
EXPORTING
absolute_uri = p_url
rfc_destination = p_dest
blankstocrlf = 'Y'
IMPORTING
status_code = g_status
status_text = g_statustext
response_entity_body_length = g_length
TABLES
response_entity_body = gt_response
response_headers = gt_response_header
EXCEPTIONS
connect_failed = 1
timeout = 2
internal_error = 3
tcpip_error = 4
data_error = 5
system_failure = 6
communication_failure = 7
OTHERS = 8.
IF sy-subrc <> 0.
ENDIF.
阅读(7650) | 评论(0) | 转发(1) |