本文作者:佚名

Oracle UTL_HTTP(收集汇总实用资料)

佚名 2019-04-09 ???
摘要:From OracleThe UTL_HTTP package makes Hypertext Transfer Protocol (HTTP) callouts from SQL and PL/SQL. You can use it to


From oracle

The UTL_HTTP package makes Hypertext Transfer Protocol (HTTP) callouts from SQL and PL/SQL. You can use it to access data on the Internet over HTTP.

When the package fetches data from a Web site using HTTPS, it requires Oracle Wallet Manager which can be created by either Oracle Wallet Manager or the orapki utility. Non-HTTPS fetches do not require an Oracle wallet.

See Also:

  • Chapter 239, UTL_URL

  • Chapter 236, UTL_SMTP

  • Oracle Database Advanced Security Administrator"s Guide for more information on Wallet Manager

This chapter contains the following topics:

  • Using UTL_HTTP

    • Overview

    • Security Model

    • Constants

    • Datatypes

    • Operational Notes

    • Exceptions

    • Examples

  • Subprogram Groups

    • Session Settings Subprograms

    • HTTP Requests Subprograms

    • HTTP Request Contexts Subprograms

    • HTTP Responses Subprograms

    • HTTP cookies Subprograms

    • HTTP Persistent Connections Subprograms

    • Error Conditions Subprograms

  • Summary of UTL_HTTP Subprograms


Using UTL_HTTP

This section contains topics which relate to using the UTL_HTTP package.

  • Overview

  • Security Model

  • Constants

  • Datatypes

  • Operational Notes

  • Exceptions

  • Examples


Overview

With the UTL_HTTP package, you can write PL/SQL programs that communicate with Web (HTTP) servers. And UTL_HTTP contains a function that can be used in SQL queries.

The package supports HTTP over the Secured Socket Layer protocol (SSL), also known as HTTPS. It also supports SSL client authentication by sending the client-certificate in a wallet to authenticate with the remote Web server.

Other Internet-related data-access protocols (such as the File Transfer Protocol (FTP) or the Gopher protocol) are also supported using an HTTP proxy server that supports those protocols.


Security Model

This package is an invoker"s rights package and the invoking user will need the connect privilege granted in the access control list assigned to the remote network host to which he wants to connect, as well as the use-client-certificates or the use-passwords privilege to authenticate himself with the remote Web server using the credentials stored in an Oracle wallet.

Note:

For more information, see Managing Fine-grained Access to External Network Services in Oracle Database Security Guide

Constants

The UTL_HTTP package uses the constants shown in following tables.

  • UTL_HTTP Constants - HTTP Versions

  • UTL_HTTP Constants - Default Ports

  • UTL_HTTP Constants - HTTP 1.1 Status Codes

Table 225-1 UTL_HTTP Constants - HTTP Versions

rame="hsides" rules="groups" cellpadding="3" cellspacing="0" >
NameTypeValueDescription

HTTP_VERSION_1_0

VARCHAR2(10)

"HTTP/1.0"

Denotes HTTP version 1.0 that can be used in the functionBEGIN_REQUEST.

HTTP_VERSION_1_1

VARCHAR2(10)

"HTTP/1.1"

Denotes HTTP version 1.1 that can be used in the functionBEGIN_REQUEST.


Table 225-2 UTL_HTTP Constants - Default Ports

rame="hsides" rules="groups" cellpadding="3" cellspacing="0" >
NameTypeValueDescription

DEFAULT_HTTP_PORT

PLS_INTEGER

80

The default TCP/IP port (80) at which a Web server or proxy server listens

DEFAULT_HTTPS_PORT

PLS_INTEGER

443

The default TCP/IP port (443) at which an HTTPS Web server listens


Table 225-3 UTL_HTTP Constants - HTTP 1.1 Status Codes

rame="hsides" rules="groups" cellpadding="3" cellspacing="0" >
NameTypeValueDescription

HTTP_CONTINUE

PLS_INTEGER

100

The client should continue with its request. This interim response is used to inform the client that the initial part of the request has been received and has not yet been rejected by the server.

HTTP_SWITCHING_PROTOCOLS

PLS_INTEGER

101

The server understands and is willing to comply with the client"s request, through the Upgrade message header field, for a change in the application protocol being used on this connection. The server will switch protocols to those defined by the response"s Upgrade header field immediately after the empty line which terminates the 101 response.

HTTP_OK

PLS_INTEGER

200

The request has succeeded. The information returned with the response is dependent on the method used in the request

HTTP_CREATED CONSTANT

PLS_INTEGER

201

The request has been fulfilled and resulted in a new resource being created.

HTTP_ACCEPTED

PLS_INTEGER

202

The request has been accepted for processing, but the processing has not been completed. The request might or might not eventually be acted upon, as it might be disallowed when processing actually takes place.

HTTP_NON_AUTHORITATIVE_INFO

PLS_INTEGER

203

The returned metainformation in the entity-header is not the definitive set as available from the origin server, but is gathered from a local or a third-party copy.

HTTP_NO_CONTENT

PLS_INTEGER

204

The server has fulfilled the request but does not need to return an entity-body, and might want to return updated metainformation.

HTTP_RESET_CONTENT

PLS_INTEGER

205

The server has fulfilled the request and the user agent should reset the document view which caused the request to be sent. The response must not include an entity.

HTTP_PARTIAL_CONTENT

PLS_INTEGER

206

The server has fulfilled the partial GET request for the resource.

HTTP_MULTIPLE_CHOICES

PLS_INTEGER

300

The requested resource corresponds to any one of a set of representations, each with its own specific location, and agent- driven negotiation information is being provided so that the user (or user agent) can select a preferred representation and redirect its request to that location.

HTTP_MOVED_PERMANENTLY

PLS_INTEGER

301

The requested resource has been assigned a new permanent URI and any future references to this resource should use one of the returned URIs.

HTTP_FOUND CONSTANT

PLS_INTEGER

302

The requested resource resides temporarily under a different URI.

HTTP_SEE_OTHER

PLS_INTEGER

303

The response to the request can be found under a different URI and should be retrieved using a GET method on that resource.

HTTP_NOT_MODIFIED

PLS_INTEGER

304

If the client has performed a conditional GET request and access is allowed, but the document has not been modified, the server responds with this status code.

HTTP_USE_PROXY

PLS_INTEGER

305

The requested resource must be accessed through the proxy given by the Location field. The Location field gives the URI of the proxy.

HTTP_TEMPORARY_REDIRECT

PLS_INTEGER

307

The requested resource resides temporarily under a different URI.

HTTP_BAD_REQUEST

PLS_INTEGER

400

The request could not be understood by the server due to malformed syntax.

HTTP_UNAUTHORIZED

PLS_INTEGER

401

The request requires user authentication. The client may repeat the request with a suitable Authorization header field. If the

未经允许不得转载:

作者:佚名,标题:Oracle UTL_HTTP(收集汇总实用资料),原文地址:https://www.vfjianzhan.com/php/gjjc/yinyong/68589.html发布于2019-04-09
转载或复制请以超链接形式并注明出处唯福建站

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏