0

我真的找不到cfhttp method=options.

我在许多网站上看到了cfhttp具有名为 的方法的文档options,但它们并没有真正展示我们如何使它工作。我试图搜索 http options,但对如何使用它、它的实际用途是什么以及如何实现它一无所知。

4

1 回答 1

2

这是来自 ColdFusion 9 文档,在我看来,最新的 ColdFusion 版本的官方文档没有很好地呈现,所以,如果可以的话,我总是回到 cf9 文档。那里也有一些代码示例。

https://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7ffc.html

<cfhttp  
    url = "server URL" 
    charset = "character encoding" 
    clientCert = "filename" 
    clientCertPassword = "password" 
    columns = "query columns" 
    delimiter = "character" 
    file = "filename" 
    firstrowasheaders = "yes|no" 
    getAsBinary = "auto|yes|no|never" 
    method = "method name" 
    multipart = "yes|no" 
    name = "query name" 
    password = "password" 
    path = "path" 
    port = "port number" 
    proxyServer = "host name" 
    proxyPort = "port number" 
    proxyUser = "username" 
    proxyPassword = "password" 
    redirect = "yes|no" 
    resolveURL = "yes|no" 
    result = "result name" 
    textQualifier = "character" 
    throwOnError = "yes|no" 
    timeout = "time-out period in seconds" 
    username = "username" 
    userAgent = "user agent"> 

    cfhttpparam tags [optional for some methods] 

</cfhttp>

另一个很好的资源是https://cfdocs.org/cfhttp,其中包含script语法示例,例如:

cfhttp(method="GET", charset="utf-8", url="https://www.google.com/", result="result") {
    cfhttpparam(name="q", type="formfield", value="cfml");
}
writeDump(result);

此外,可以在https://helpx.adobe.com/coldfusion/cfml-reference/user-guide.html找到当前的 Adob​​e ColdFusion 官方文档

于 2018-04-22T16:19:08.983 回答