Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

SocialRequest.GetResponse

Queries details on the response.

Component Version macOS Windows Linux Server iOS SDK
Social 5.3 ✅ Yes ❌ No ❌ No ❌ No ✅ Yes

Deprecated

This function was deprecated.

MBS( "SocialRequest.GetResponse"; Request; Selector { ; Encoding } )   More

Parameters

Parameter Description Example Flags
Request The reference number for the social request as you got it from SocialRequest.New function. $request
Selector Which value to query. Can be Error, Response, StatusCode, URL, MIMEType, expectedContentLength, textEncodingName, suggestedFilename, StatusCodeText, Headers or a HTTP header field. "Response"
Encoding The text encoding for result in case you use "Response" for selector.
Default is UTF-8.
Possible encoding names: ANSI, ISO-8859-1, Latin1, Mac, Native, UTF-8, DOS, Hex, Base64 or Windows. More listed in the FAQ.
UTF8 Optional

Result

Returns value or error.

Description

Queries details on the response.
You can use this to query if the request was successful.
For a successful request, the error value is empty (no error sending) and StatusCode is 200 (no error in web service). The response text may be xml/json depending on service and have more details. MIMEType provides data type for the response, normally text/xml or application/json.
You can use Text.MimeTypeToFileExtension to find the file extension for mime type.

Examples

Script triggered after tweeting finished:

Set Variable [$request; Value:Get(ScriptParameter)]
Set Field [Tweets::Status; MBS( "SocialRequest.GetResponse"; $request; "StatusCode" )]
Set Field [Tweets::Response; MBS( "SocialRequest.GetResponse"; $request; "Response" )]
Set Field [Tweets::ErrorMessage; MBS( "SocialRequest.GetResponse"; $request; "Error" )]
Set Field [Tweets::Headers; MBS( "SocialRequest.GetResponse"; $request; "Headers" )]
Set Variable [$r; Value:MBS( "SocialRequest.Release"; $request )]

See also

Example Databases

This function is free to use.

Created 28th August 2015, last changed 12nd June 2020


SocialRequest.GetRequestMethod - SocialRequest.GetServiceType