CURL.SetOptionInterface
-----------------------

This sets the interface name to use as outgoing network interface.

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

MBS( "CURL.SetOptionInterface"; curl; Value { ; Encoding } ) 

**MBS**( **"CURL.SetOptionInterface";** /\* This sets the interface name to use as outgoing network interface. \*/  
**$curl**; /\* The CURL session handle. \*/   
**$Value**; /\* Interface name.e.g. en0 \*/   
**$Encoding**) /\* Optional; The text encoding for text parameter.   
Default is UTF-8.e.g. "utf8" \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| curl | The CURL session handle. | $curl |  |
| Value | Interface name. | en0 |  |
| Encoding | The text encoding for text parameter.    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 "OK" on success.

### Description

This sets the interface name to use as outgoing network interface.  
The name can be an interface name, an IP address, or a host name.  
See also [INTERFACE](https://curl.haxx.se/libcurl/c/CURLOPT_INTERFACE.html) option in CURL manual.

### Examples

Try with an explicit interface:

 Set Variable \[ $curl ; Value: MBS ("[CURL.New](CURLNew.md)") \]  
\# put in some URL   
Set Variable \[ $r ; Value: MBS ("[CURL.SetOptionURL](CURLSetOptionURL.md)"; $curl ; "https://www.monkeybreadsoftware.com/filemaker/examples/test.txt") \]  
\# Request which interface to use   
Set Variable \[ $r ; Value: MBS ("CURL.SetOptionInterface"; $curl ; "en0") \]  
\# perform request   
Set Variable \[ $result ; Value: MBS ("[CURL.Perform](CURLPerform.md)"; $curl ) \]  
\# check result   
Set Field \[ CURL Test::Debug Messages ; Value: MBS ("[CURL.GetDebugMessages](CURLGetDebugMessages.md)"; $curl ) \]  
Set Field \[ CURL Test::Result ; Value: MBS ("[CURL.GetResultAsText](CURLGetResultAsText.md)"; $curl ) \]  
\# cleanup   
Set Variable \[ $result ; Value: MBS ("[CURL.Release](CURLRelease.md)"; $curl ) \]  
### See also

- [CURL.GetDebugMessages](CURLGetDebugMessages.md)
- [CURL.GetOptionUserName](CURLGetOptionUserName.md)
- [CURL.New](CURLNew.md)
- [CURL.Perform](CURLPerform.md)
- [CURL.Release](CURLRelease.md)
- [CURL.SetOptionIPResolve](CURLSetOptionIPResolve.md)
- [CURL.SetOptionLocalPort](CURLSetOptionLocalPort.md)
- [CURL.SetOptionURL](CURLSetOptionURL.md)
- [CURL.SetOptionUserName](CURLSetOptionUserName.md)
- [CURL.SetOptionVerbose](CURLSetOptionVerbose.md)

### Blog Entries

- [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)

Created 18th August 2014 , last changed 24th February 2026

  
[CURL.SetOptionInFileSize](CURLSetOptionInFileSize.md) - [CURL.SetOptionIssuerCert](CURLSetOptionIssuerCert.md)

[HTML Version](CURLSetOptionInterface.shtml)