InvokeS

<< Fare clic per visualizzazione il sommario >>

Percorso:  API di piattaforma > Altri servizi > Rest >

InvokeS

Service

Rest

 

Method

InvokeS

 

Description

Invokes a REST service and returns a stream containing the service output.

 

Input

Name

Description

Type

Optional

baseUrl

The base url of the REST service (ex.: “https://api.twitter.com/1.1/”).

Required, unless specified in the “BaseUrl” configuration field.

String

 

resource

The resource (ex.: “statuses/show.json”).

Required, unless specified in the “Resource” configuration field.

String

 

parameters

Resource parameters, separated by the & character (ex.: “?id=210462857140252672&trim_user=true”).

Methods ParametersToString, Detokenize or SimpleDetokenize can be used to get this string.

String

 

method

The request method to use to contact the REST resource (“GET”, “POST”, “DELETE”, …).

Defaults to the “Method” configuration field, if specified, otherwise to “GET”.

String

 

contentType

The media type of the request (ex.: “application/x-www-form-urlencoded”, “text/plain”; see http://en.wikipedia.org/wiki/MIME_type).

Defaults to the “ContentType” configuration field, if specified.

String

 

data

Data to post.

Methods ParametersToString, Detokenize or SimpleDetokenize can be used to get this string.

String

 

host

The Host header value to use in the HTTP request independent from the request URI; it consists of a hostname and an optional port number (ex.: “www.contoso.com:8080″).

Defaults to the “Host” configuration field, if specified, otherwise it is derived from baseUrl.

String

 

userAgent

The user-agent header value (ex.: “.NET Framework Test Client”).

Defaults to the “UserAgent” configuration field, if specified.

String

 

timeout

The number of milliseconds to wait before the request times out.

Defaults to the “Timeout” configuration field, if specified, otherwise to 100000 (100 seconds).

Int

 

maximumAutomaticRedirections

The maximum number of redirection responses that the request follows; -1 indicates automatic redirections are not allowed.

Defaults to the “MaximumAutomaticRedirections” configuration field, if specified, otherwise to 50.

Int

 

maximumResponseHeadersLength

The maximum allowed length of the response headers, in kilobytes (1024 bytes); a value of -1 means no limit is imposed on the response headers received.

Defaults to the “MaximumResponseHeadersLength” configuration field, if specified, otherwise to 64.

Int

 

headers

Additional headers for the HTTP request; for example, it can contain the “Authorization” header for the “OAuth” authentication (see http://tools.ietf.org/html/rfc5849#section-3.5.1 and http://hueniverse.com/oauth/guide/authentication/). It can also contain the standard headers "Method", "ContentType", "Host", "UserAgent", "Timeout", MaximumAutomaticRedirections", "MaximumResponseHeadersLength" and "Accept", but if there are corresponding parameters with non-null values, they prevail.

Dataset

 

credentialsType

Type of the authentication credentials associated with the request:

1 = None (credentials not required or otherwise specified, maybe through the "Authorization" header)

2 = NetworkCredentials ("userName" and "password" must be specified)

3 = DefaultNetworkCredentials (the network credentials of the current security context)

4 = DefaultCredentials (the system credentials of the application)

5 = BasicAuthentication ("UserName" and "Password" must be specified)

Defaults to the "CredentialsType" configuration field, if specified, otherwise to 1 (None).

Int

 

userName

User name (required if “CredentialsType” = 2 or 5).

Defaults to the “UserName” configuration field, if specified.

String

 

password

Password (required if “CredentialsType” = 2 or 5).

Defaults to the “Password” configuration field, if specified.

String

 

Output

Name

Description

Type

Optional

returnValue

A reference to the process attachment created from the stream containing the service output.

Reference

 

 

Remarks

If only the complete url is available (not its baseUrl and resource parts), it can be passed in anyone of the two parameters (baseUrl or resource) leaving the other empty.