HTTP access for Oracle

Source: Internet
Author: User

Oracle leverages the UTL_HTTP package to provide access to HTTP tools.

The following code is online search, you can run directly in the Plsql.

Declare

Req Utl_http. REQ;
Resp Utl_http. RESP;
Val varchar2 (32767);
Begin

Req: = Utl_http. Begin_request (' http://www.sohu.com ');
Utl_http.set_header (req, ' content-type ', ' text/html; Charset=utf-8 ');--add this
RESP: = utl_http. Get_response (req);
Utl_http.read_line (Resp, Val, true);
Utl_http.end_response (RESP);
Dbms_output.put_line (Val);

EXCEPTION
When Utl_http.end_of_body Then
Utl_http.end_response (RESP);
End

If you just want to call a URL, you can use the following statement

Select Utl_http.request (' http://www.sohu.com ') from dual

The above content did not delve into, the time to study, first recorded

HTTP access for Oracle

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.