HTTPCaller
通过HTTP访问URL或HTTPS, performing a GET, PUT, POST, DELETE, HEAD, PATCH or OPTIONS operation.
This transformer replaces the HTTPFetcher, HTTPUploader, HTTPFileUploader, HTTPMultipartUploader, HTTPDeleter and HTTPHeader transformers.
Output
The HTTP response body may be saved to an attribute, or a file.By default the body is saved to the attribute identified by the响应体属性parameter.
The HTTP response status code will be stored in the attribute named by the状态代码属性parameter.By default this is the_http_status_codeattribute.For more information on HTTP Status Codes, please refer tohttp://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html。
In addition, the HTTP response headers will be saved in the list attribute specified by the列表属性响应头parameter.By default the headers are stored in the_headers{}list attribute.For a list of common HTTP response headers, please refer tohttp://en.wikipedia.org/wiki/List_of_HTTP_header_fields。
If an error occurs while accessing the URL, the feature will be output via the
Parameters
Request
This parameter identifies the HTTP method which will be used to access the server.Most requests will use theGETmethod.Requests which upload data will use thePUT,POST要么PATCHmethod.TheHEAD,DELETEandOPTIONSmethods can be useful when accessing a REST API.
This parameter identifies the URL which will be accessed by the transformer.The transformer can access http and https URLs.The URL can be entered directly in the transformer, or be built up from attribute values.
Query String Parameters
This table can be used to create additional URL query parameters.The parameters will be appended to the URL given in theRequest URLparameter.This can be useful when accessing a REST API endpoint which requires many parameters.The parameter names and values can be entered directly or constructed from attribute values.
Headers
This table can be used to create custom HTTP headers which will be sent along with the request.This can be used to customize the request that FME will make to the server.Header names and values can be entered directly or constructed from attribute values.In addition, the Name column provides a list of commonly used header names.
Body
The parameters in this group are only enabled when theHTTP Method参数设置为PUT,POST要么PATCH。
This parameter identifies the type of data that will be uploaded.The transformer can upload a file, a string value, or a multi-part combination of file and string values.
Upload data may be entered using this parameter.The data may be entered directly into the transformer or constructed from attribute values.
When uploading a file, this parameter provides the file path.The path may be entered directly into the transformer or set from an attribute value.
When uploading a string value or a file, this parameter provides the data content type.The value of this parameter will be sent in the Content-Type request header.
This table is used to construct multipart uploads.Each part in a multipart upload must have a name, which is given in the first column.The second column identifies the type of part – either a file or a string value.The third column provides the data and MIME type for the part.
Response
This parameter allows users to set the destination for the HTTP response body.The body may be saved to an attribute, or to a file.
注意:If you are downloading a very large response body with the HTTPCaller, it is recommended that you save it to a file.这避免了创建要素上大属性。
当保存的响应身体的属性,此参数名称将被使用的属性。默认属性名称_response_body。当执行HTTP HEAD请求,该属性将是空的。
此参数用来指示目标属性的字符编码。默认情况下,属性的编码将被自动地从HTTP响应报头确定。可替代地,特定的编码可以从列表中选择。当下载的二进制数据,参数应设置为Binary要么Auto Detect from HTTP Headers。
Save Response Body To File
此参数控制中,变压器将响应主体保存到文件的方式。有两种模式:
- 没有: The response body will be saved to the file specified in the输出文件名parameter.
- 是: A new file will be created for each feature, and saved in the folder specified in the导出目录parameter.
当。。。的时候创建一个新的文件中,每个功能参数设置为没有,变压器将HTTP响应体保存到这个参数中指定的文件。该文件可以被直接选择的,或从一个属性集。请注意,如果该文件是直接选择,该文件将被覆盖由通过变压器的每个功能。如果有多个功能通过变压器,建议的文件路径设置为一个独特的属性值,或变压器被配置为创建各功能的新文件。
当。。。的时候创建一个新的文件中,每个功能参数设置为是,变压器将为通过变压器各功能的新文件。该文件将被保存在这个参数中指定的文件夹中。
响应体已被保存到一个文件后,在此参数命名的属性将被设置为文件路径。
Response Headers and Status
此参数是可选。如果它被设置为一个列表属性名称,然后HTTP头由服务器返回将被存储在列表中的属性。标头将分为名称和值。例如:
`_headers {0}。名称 '具有值'X-XSS-保护'
`_headers {0}。价值”具有值'1;模式=块”
`_headers {1}。名称 '具有值'日期'
`_headers {1}。价值 '具有值'星期三,2011年5月25日17点二十○分20秒GMT'
`_headers {2}。名称“具有值'传送编码”
`_headers {2}。价值 '具有值'分块'
`_headers {3}。名称“具有值'内容 - 类型”
`_headers {3}。价值”具有值'text / html的;字符集= ISO-8859-1'
`_headers {4}。名称“具有值'缓存控制”
`_headers {4}。价值”具有值'私人,最大年龄= 0'
此参数是可选。如果它被设置到一个属性名称,然后由服务器返回的HTTP响应代码将被存储在所述属性。
此参数是可选。如果出现错误,该功能将通过输出
HTTP Client Options
如果这个参数设置为是,对应于URL访问的任何保存的cookies将与请求一起发送。此外,包含在响应中的任何cookie将被保存,以备以后的HTTP请求中使用。
保存的cookies将持续翻译的时间 - 他们不能在后续的翻译中。
当Web服务保持一个“会话”保存的cookies是有用的。然后,可以使用以下的操作顺序:
- An HTTPCaller transformer is used to log in to the web service and a session cookie is saved.
- A second HTTPCaller transformer is used to access the web service, utilizing the saved session cookie.
- A third HTTPCaller is used to log out of the web service, which invalidates the saved cookie.
如果这个参数设置为是,变压器将按照所遇到的任何URL重定向,使得第二请求到一个新的位置。
如果这个参数设置为是,变压器将验证SSL证书。这两个阶段完成:
- Ensure that the certificate is for the host we are trying to connect to.
- Ensure that the certificate is valid.
此参数可用于设置HTTP连接请求超时。如果与服务器的连接不能秒的给定数量的内创建,该请求将失败,并且该特征将被输出经过
该参数可用于设置HTTP传输的超时。如果数据停止被传送超过几秒钟的给定数目的,请求将失败,并且该特征将被输出经过
Authentication Parameters
有两种方式则Transformer支持用户认证:命名连接和用户名/密码认证。
验证用户名和密码时, the basic, digest and NTLM access authentication methods are supported:
- 基本(HTTP Basic authentication): This is the default choice, and the only method in widespread use and supported virtually everywhere.This sends the username and password over the network in plain text, easily captured by others.
- 消化(HTTP摘要式身份验证):摘要式身份验证超过基本方法确保通过公共网络。
- NTLM(HTTP NTLM认证):NTLM是发明和Microsoft使用的专有协议。它采用类似于摘要挑战响应和散列的概念,以防止密码被窃听。
注意:没有te that although the HTTP Basic access authentication is a mechanism designed to allow a client to provide credentials to a server on the assumption that the connection between them is trusted and secure, be aware that any credentials passed from client to server can be easily intercepted through an insecure connection.
Editing Transformer Parameters
Using a set of menu options, transformer parameters can be assigned by referencing other elements in the workspace.More advanced functions, such as an advanced editor and an arithmetic editor, are also available in some transformers.To access a menu of these options, clickbeside the applicable parameter.For more information, seeTransformer Parameter Menu Options。
Transformer Categories
FME Licensing Level
FME Professional edition and above
Search FME Knowledge Center
Search for samples and information about this transformer on theFME Knowledge Center。
标签Keywords: URLFetcher