CURL.GetResponseCode
--------------------

Get the last received HTTP or FTP code.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [CURL](component_CURL.md) | [2.5](newinversion25.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "CURL.GetResponseCode"; curl ) 

**MBS**( **"CURL.GetResponseCode";** /\* Get the last received HTTP or FTP code. \*/  
**$curl**) /\* The CURL session handle. \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| curl | The CURL session handle. | $curl |

### Result

Returns the requested value or nothing on error.

### Description

Get the last received HTTP or FTP code.   
This will be zero if no server response code has been received. Note that a proxy's CONNECT response should be read with [CURL.GetHTTPConnectCode](CURLGetHTTPConnectCode.md) and not this.  
For HTTP this is the normal status code. e.g. 200 for OK and 404 for file not found.  
### Examples

On success puts download in container, else shows failed:

 Set Variable \[$errorCode ; Value:MBS ("[CURL.ErrorCode](CURLErrorCode.md)"; $curl )\]  
Set Variable \[$httpResult ; Value:MBS ("CURL.GetResponseCode"; $curl )\]  
Set Field \[Download Async::Result ; $errorCode \]  
Set Field \[Download Async::DebugMessages ; MBS ("[CURL.GetDebugMessages](CURLGetDebugMessages.md)"; $curl )\]  
If \[$errorCode = 0 and $httpResult = 200\]  
 Set Field \[Download Async::Progress ; "Done"\]  
 Set Field \[Download Async::Output ; MBS ("[CURL.GetResultAsContainer](CURLGetResultAsContainer.md)"; $curl )\]  
Else  
 Set Field \[Download Async::Progress ; "Failed"\]  
 Set Field \[Download Async::Output ; ""\]  
End If  
### See also

- [CURL.GetDebugMessages](CURLGetDebugMessages.md)
- [CURL.GetFileTime](CURLGetFileTime.md)
- [CURL.GetHTTPConnectCode](CURLGetHTTPConnectCode.md)
- [CURL.GetResultAsContainer](CURLGetResultAsContainer.md)
- [CURL.Perform](CURLPerform.md)
- [CURL.SetOptionFileTime](CURLSetOptionFileTime.md)
- [CURL.SetOptionSSLCert](CURLSetOptionSSLCert.md)
- [CURL.SetupOAuth](CURLSetupOAuth.md)
- [JSON.GetPathItem](JSONGetPathItem.md)
- [JSON.Parse](JSONParse.md)

### Example Databases

- [CURL/Amazon S3/Amazon S3 Buckets](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/Amazon%20S3/Amazon%20S3%20Buckets.shtml#1ScriptAnchor_)
- [CURL/Amazon S3/Containers in S3](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/Amazon%20S3/Containers%20in%20S3.shtml#2ScriptAnchor_)
- [CURL/CURL Download Picture](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/CURL%20Download%20Picture.shtml#1ScriptAnchor_)
- [CURL/Email/Office 365 oAuth SMTP](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/Email/Office%20365%20oAuth%20SMTP.shtml#3ScriptAnchor_)
- [CURL/WebServices/AdobeSign WebService](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/WebServices/AdobeSign%20WebService.shtml#18ScriptAnchor_)
- [CURL/WebServices/CURL FMS Admin API v17](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/WebServices/CURL%20FMS%20Admin%20API%20v17.shtml#1ScriptAnchor_)
- [CURL/WebServices/CURL FMS Admin API v18](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/WebServices/CURL%20FMS%20Admin%20API%20v18.shtml#1ScriptAnchor_)
- [CURL/WebServices/magento older](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/WebServices/magento%20older.shtml#3ScriptAnchor_)
- [CURL/WebServices/Query IP and Country](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/WebServices/Query%20IP%20and%20Country.shtml#1ScriptAnchor_)
- [CURL/WebServices/Sales Force Test](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/WebServices/Sales%20Force%20Test.shtml#1ScriptAnchor_)

### Blog Entries

- [Using Gmail with oAuth2 for SMTP with MBS Plugin](https://www.mbsplugins.de/archive/2025-05-08/Using_Gmail_with_oAuth2_for_SM/monkeybreadsoftware_blog_filemaker)
- [Send Audit Log via CURL in background](https://www.mbsplugins.de/archive/2023-11-30/Send_Audit_Log_via_CURL_in_bac/monkeybreadsoftware_blog_filemaker)
- [How long do you wait for Insert From URL to finish?](https://www.mbsplugins.de/archive/2023-10-10/How_long_do_you_wait_for_Inser/monkeybreadsoftware_blog_filemaker)
- [SMTP with OAuth for Office 365 in FileMaker](https://www.mbsplugins.de/archive/2022-11-22/SMTP_with_OAuth_for_Office_365/monkeybreadsoftware_blog_filemaker)
- [Translating Insert from URL options for CURL to MBS Plugin calls](https://www.mbsplugins.de/archive/2020-12-14/Translating_Insert_from_URL_op/monkeybreadsoftware_blog_filemaker)
- [Using Apple's Global Service Exchange web service in FileMaker](https://www.mbsplugins.de/archive/2019-09-04/Using_Apples_Global_Service_Ex/monkeybreadsoftware_blog_filemaker)
- [Comparing Base Elements Plugin to MBS FileMaker Plugin](https://www.mbsplugins.de/archive/2017-10-24/Comparing_Base_Elements_Plugin/monkeybreadsoftware_blog_filemaker)
- [Using Apple's Global Service Exchange web service in FileMaker](https://www.mbsplugins.de/archive/2017-02-21/Using_Apples_Global_Service_Ex/monkeybreadsoftware_blog_filemaker)
- [Query geolocation in FileMaker via MBS Plugin and Google Maps API](https://www.mbsplugins.de/archive/2017-01-25/Query_geolocation_in_FileMaker/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 2/2024, Seite 18](https://filemaker-magazin.de/neuigkeit/4257-Appetithappen-FMM_202402)
- [Ausgabe 4/2016, Seite 20](https://filemaker-magazin.de/neuigkeit/3876-Appetithappen-FMM_201604)

This function checks for a license.

Created 18th August 2014 , last changed 12nd July 2015

  
[CURL.GetRequestSize](CURLGetRequestSize.md) - [CURL.GetResultAsContainer](CURLGetResultAsContainer.md)

[HTML Version](CURLGetResponseCode.shtml)