Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

Read Https website content using report program

$
0
0

Hi ,

 

I need your help experts. I need to validate website url and read its content. For example http://www.google.com.

I am able read non https url content but when I am trying to read content for https url my below code is not working like https://www.google.com its not working but url is validate. How do i read https website content without certificate download

 

Below is my program please suggest.

 

DATA: http_client TYPE REF TO if_http_client .

 

DATA: wf_string TYPE string ,

 

result TYPE string ,

 

r_str TYPE string .

 

DATA: result_tab TYPE TABLE OF string.

 

START-OF-SELECTION .

 

  CLEAR wf_string .

 

wf_string = 'https://www.google.com'.

 

 

  CALL METHOD cl_http_client=>create_by_url

    EXPORTING

      url                = wf_string

    IMPORTING

      client             = http_client

    EXCEPTIONS

      argument_not_found = 1

      plugin_not_active  = 2

      internal_error     = 3

      OTHERS             = 4.

 

 

  CALL METHOD http_client->send

    EXCEPTIONS

      http_communication_failure = 1

      http_invalid_state         = 2.

 

 

  CALL METHOD http_client->receive

    EXCEPTIONS

      http_communication_failure = 1

      http_invalid_state         = 2

      http_processing_failed     = 3.

 

  CLEAR result .

 

  result = http_client->response->get_cdata( ).

 

 

  REFRESH result_tab .

 

  SPLIT result AT cl_abap_char_utilities=>cr_lf INTO TABLE result_tab .

 

  LOOP AT result_tab INTO r_str.

 

    WRITE:/ r_str .

 

  ENDLOOP .

 

Thanks,

NJ


Viewing all articles
Browse latest Browse all 8332

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>