SocialRequest.GetResponse
-------------------------

Queries details on the response.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Social](component_Social.md) | [5.3](newinversion53.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ✅ Yes |

### Deprecated

This function was [deprecated](deprecated.md).

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

**MBS**( **"SocialRequest.GetResponse";** /\* Queries details on the response. \*/  
**$Request**; /\* The reference number for the social request as you got it from [SocialRequest.New](SocialRequestNew.md) function. \*/   
**$Selector**; /\* Which value to query. Can be Error, Response, StatusCode, URL, MIMEType, expectedContentLength, textEncodingName, suggestedFilename, StatusCodeText, Headers or a HTTP header field.e.g. "Response" \*/   
**$Encoding**) /\* Optional; The text encoding for result in case you use "Response" for selector.   
Default is UTF-8.e.g. UTF8 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| Request | The reference number for the social request as you got it from [SocialRequest.New](SocialRequestNew.md) 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](https://www.monkeybreadsoftware.com/filemaker/faq.shtml). | 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](TextMimeTypeToFileExtension.md) 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](SocialRequestRelease.md)"; $request )\]  
### See also

- [SocialRequest.GetAccount](SocialRequestGetAccount.md)
- [SocialRequest.GetURL](SocialRequestGetURL.md)
- [SocialRequest.New](SocialRequestNew.md)
- [SocialRequest.Perform](SocialRequestPerform.md)
- [SocialRequest.Release](SocialRequestRelease.md)
- [Text.MimeTypeToFileExtension](TextMimeTypeToFileExtension.md)

### Example Databases

- [Mac only/Tweet on Twitter](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20only/Tweet%20on%20Twitter.shtml#6ScriptAnchor_)

This function is free to use.

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

  
[SocialRequest.GetRequestMethod](SocialRequestGetRequestMethod.md) - [SocialRequest.GetServiceType](SocialRequestGetServiceType.md)

[HTML Version](SocialRequestGetResponse.shtml)