CURL.FormAddKeyValue
--------------------

Add a section to a multipart/formdata HTTP POST.

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

MBS( "CURL.FormAddKeyValue"; curl; Name; Value { ; ContentType; ContentHeaders } ) 

**MBS**( **"CURL.FormAddKeyValue";** /\* Add a section to a multipart/formdata HTTP POST. \*/  
**$curl**; /\* The CURL session handle. \*/   
**$Name**; /\* The name of the form field.e.g. "city" \*/   
**$Value**; /\* The value for the form field.e.g. "Nickenich" \*/   
**$ContentType**; /\* Optional; The mime content type for this field.e.g. "text/html" \*/   
**$ContentHeaders**) /\* Optional; List of headers to include.e.g. "Content-Id: 12345" \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| curl | The CURL session handle. | $curl |  |
| Name | The name of the form field. | "city" |  |
| Value | The value for the form field. | "Nickenich" |  |
| ContentType | The mime content type for this field. | "text/html" | Optional      Added in version **10.3**. |
| ContentHeaders | List of headers to include. | "Content-Id: 12345" | Optional      Added in version **10.3**. |

### Result

Returns "OK" or error code.

### Description

Add a section to a multipart/formdata HTTP POST.  
This adds simply form field with a given name and value.  
For text encoding UTF-8 is used here.  
  
Please call [CURL.FormFinish](CURLFormFinish.md) after you added all your fields and before you call [CURL.Perform](CURLPerform.md).  
### Examples

Sets city in a form

 MBS ( "CURL.FormAddKeyValue"; $curl ; "City"; "Nickenich" )  
Build form:

 MBS ( "CURL.FormAddKeyValue"; $curl ; "login"; "testuser" )  
MBS ( "CURL.FormAddKeyValue"; $curl ; "password"; "xxx" )  
MBS ( "[CURL.FormFinish](CURLFormFinish.md)"; $curl )  
### See also

- [CURL.FormAddKeyContainerContentType](CURLFormAddKeyContainerContentType.md)
- [CURL.FormAddKeyFile](CURLFormAddKeyFile.md)
- [CURL.FormAddKeyText](CURLFormAddKeyText.md)
- [CURL.FormAddKeyValueContentType](CURLFormAddKeyValueContentType.md)
- [CURL.FormFinish](CURLFormFinish.md)
- [CURL.GetFormData](CURLGetFormData.md)
- [CURL.Perform](CURLPerform.md)
- [CURL.SetOptionPassword](CURLSetOptionPassword.md)
- [CURL.SetOptionPostFields](CURLSetOptionPostFields.md)

### Release notes

- **Version 10.3**
    - Added ContentType and ContentHeaders parameter for [CURL.FormAddKeyContainer](https://www.mbsplugins.eu/CURLFormAddKeyContainer.shtml), [CURL.FormAddKeyFile](https://www.mbsplugins.eu/CURLFormAddKeyFile.shtml), [CURL.FormAddKeyText](https://www.mbsplugins.eu/CURLFormAddKeyText.shtml) and [CURL.FormAddKeyValue](https://www.mbsplugins.eu/CURLFormAddKeyValue.shtml).

### Example Databases

- [CURL/CURL Send Form](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/CURL%20Send%20Form.shtml#1ScriptAnchor_)
- [CURL/WebServices/TinyURL](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/WebServices/TinyURL.shtml#1ScriptAnchor_)
- [Third Party/Google OAUTH 2 example](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Third%20Party/Google%20OAUTH%202%20example.shtml#1ScriptAnchor_)

### 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)
- [MBS FileMaker Plugin, version 10.3pr1](https://www.mbsplugins.de/archive/2020-06-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [Using NetVerify web service with FileMaker](https://www.mbsplugins.de/archive/2016-08-12/Using_NetVerify_web_service_wi/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 14th May 2020

  
[CURL.FormAddKeyTextContentType](CURLFormAddKeyTextContentType.md) - [CURL.FormAddKeyValueContentType](CURLFormAddKeyValueContentType.md)

[HTML Version](CURLFormAddKeyValue.shtml)