\TencentAI\KernelRequest

发起网络请求

Summary

Methods
Properties
Constants
setAppKey()
setAppId()
setRetry()
setFormat()
setCurl()
close()
exec()
returnStr()
$debug
No constants found
No protected methods found
No protected properties found
N/A
sign()
checkReturn()
$app_key
$app_id
$format
$retry
$curl
N/A

Properties

$debug

$debug : 

Type

$app_key

$app_key : 

Type

$app_id

$app_id : 

Type

$format

$format : 

Type

$retry

$retry : 

Type

$curl

$curl : \Curl\Curl

Type

\Curl\Curl

Methods

setAppKey()

setAppKey(\TencentAI\Kernel\string  $app_key) 

Parameters

\TencentAI\Kernel\string $app_key

setAppId()

setAppId(  $app_id) 

Parameters

$app_id

setRetry()

setRetry(  $retry) 

Parameters

$retry

setFormat()

setFormat(mixed  $format) 

Parameters

mixed $format

setCurl()

setCurl(\Curl\Curl  $curl, \TencentAI\Kernel\int  $timeout) 

Parameters

\Curl\Curl $curl
\TencentAI\Kernel\int $timeout

close()

close() 

exec()

exec(string  $url, array  $arg, boolean  $charSetUTF8 = true, boolean  $retry = false) : array

逻辑处理.

Parameters

string $url
array $arg
boolean $charSetUTF8
boolean $retry

Returns

array

returnStr()

returnStr(  $str) 

结果返回字符串则抛出错误.

Parameters

$str

Throws

\TencentAI\Error\TencentAIError

sign()

sign(string  $request_body) : string

生成签名.

Parameters

string $request_body

Returns

string

checkReturn()

checkReturn(integer  $ret) 

检查返回值,不为 0 抛出错误.

Parameters

integer $ret

Throws

\TencentAI\Error\TencentAIError