REST Client Configuration
-
The file_data record defines external data being uploaded to a webservicesource : textThe local filename from which to read the data to upload. Must be set.filename : textThe filename to attach to the uploaded data in the Content-Disposition header; if unset, will be derived from the source filenamecontenttype : textThe content type of the uploaded data; defaults to 'application/octet-stream' if unset
-
The httprequest record contains the request sent to an operation on the remote webservice.params : dynamic array(set of string) of anyParameters to set on the request. Refer to the operation documentation for a list of which parameters may be set for a specific operation.contenttype : textThe content type of the request; only needs to be set if it can't be inferred by the operation or the type of the body fieldbodyfilename : textThe filename from which to read the message body, if the request needs a body and the body field is unset.body : anyThe mosel value to use to populate the message body. Refer to the operation documentation for details on what types are supported by a specific operation.headers : dynamic array(set of string) of list of textArray defining additional HTTP headers to write to the request; a map from header name to list of header values to set.ifparseresponsebody : function(insightapi2~httpresponse):booleanOptional; a function that takes a insightapi2~httpresponse and returns 'true' if we shoudl try to parse the response body data from 'bodyfilename' to 'body', 'false' otherwise. If not specified, the operation will apply a default heuristic.
-
The httpresponse record contains the response returned by an operation called on the remote webservice.operid : stringThe name of the operation from the REST API that was called.status : integerThe HTTP status code; values between 200 and 299 usually indicate success.success : booleanField indicating whether the status code indicates success (read-only)errormsg : textField containing a suitable error message that describes a non-successful response. The error message will be built from the status code and any response body.headers : dynamic array(set of string) of list of textHTTP response headers; a map from header name (in lowercase) to a list of values for that headercontenttype : textThe content type of the HTTP response, e.g. 'application/json'body : anyThe value of the response body, if was a type that could be parsed into a Mosel value.bodyfilename : textThe filename in which the response body was stored, if it could not be parsed into a Mosel value. Can be set before the operation is called to write the response into a specific file.cookies : dynamic array(set of string) of textArray of cookies set by the responseNoteThe caller can set the bodyfilename attribute to force the response body to be written to a given filename; if unset, a temporary file will be used.
-
The insightconfig type represents the remote webservice we're interacting with.preprocessors : list of procedure(string,insightapi2~httprequest)procedures that will be called for every outgoing request, allowing you to (for example) add additional headers (list of procedure(operationId:string, request:insightapi2~httprequest))postprocessors : list of procedure(string,insightapi2~httpresponse)procedures that will be called for every incoming request, allowing you to perform any post-processing on the request. (list of procedure(operationId:string, response:insightapi2~httpresponse)) Post-processors are called after the body file is parsed into Mosel data structures but before the raw data has been deleted to disk; ie the response can be read from the body or bodyfilename attributes of the httpresponse record (the former only if it's of a type that could be parsed into a Mosel value).Notes1. Use the insightapi2~insightconfig_init function to initialize the insightconfig before use.
2. Advanced users can add preprocessor/postprocessor callbacks to modify or log the interactions with the wbservice
Initializes the insightconfig based on the given parameters
|
© 2001-2025 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.