CURL.GetInputAsText
-------------------

Returns the input of the transaction as text.

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

MBS( "CURL.GetInputAsText"; curl { ; Encoding; preserveLineEndings } ) 

**MBS**( **"CURL.GetInputAsText";** /\* Returns the input of the transaction as text. \*/  
**$curl**; /\* The CURL session handle. \*/   
**$Encoding**; /\* Optional; The text encoding for result.   
Default is native. This function can also handle UTF-16 as well as UTF-16LE and UTF-16BE for little/big endian byte order.e.g. "UTF-8" \*/   
**$preserveLineEndings**) /\* Optional; Whether to change line endings to CR for FileMaker.  
By default (0) we change the line endings to CR, so FileMaker has no trouble.  
Pass 1 to keep whatever line endings are there.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| curl | The CURL session handle. | $curl |  |
| Encoding | The text encoding for result.    Default is native. This function can also handle UTF-16 as well as UTF-16LE and UTF-16BE for little/big endian byte order.   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). | "UTF-8" | Optional |
| preserveLineEndings | Whether to change line endings to CR for FileMaker.   By default (0) we change the line endings to CR, so FileMaker has no trouble.   Pass 1 to keep whatever line endings are there. | 0 | Optional |

### Result

The input data as text.

### Description

Returns the input of the transaction as text.  
You are responsible for detecting decoding.   
  
Plugin version 5.2 and newer replace newlines automatically for you to match what FileMaker uses (Mac line endings).  
### Examples

Write input to a text file:

 Set Variable \[ $r ; Value: MBS ( "[Text.WriteTextFile](TextWriteTextFile.md)"; MBS ( "CURL.GetInputAsText"; $curl ; "UTF-8"; 1 ); "/tmp/test.txt" ) \]  
### See also

- [CURL.AddInputText](CURLAddInputText.md)
- [CURL.GetDebugAsText](CURLGetDebugAsText.md)
- [CURL.GetResultAsText](CURLGetResultAsText.md)
- [CURL.SetInputText](CURLSetInputText.md)
- [Text.WriteTextFile](TextWriteTextFile.md)

### Release notes

- **Version 9.3**
    - Added preserveLineEndings parameter for [CURL.GetDebugAsText](http://www.mbsplugins.eu/CURLGetDebugAsText.shtml), [CURL.GetHeaderAsText](http://www.mbsplugins.eu/CURLGetHeaderAsText.shtml), [CURL.GetInputAsText](http://www.mbsplugins.eu/CURLGetInputAsText.shtml) and [CURL.GetResultAsText](http://www.mbsplugins.eu/CURLGetResultAsText.shtml) function.

### Example Databases

- [CURL/Email/Build and send Email](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/Email/Build%20and%20send%20Email.shtml#1ScriptAnchor_)
- [CURL/Email/Build and send HTML Email with inline graphics](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/Email/Build%20and%20send%20HTML%20Email%20with%20inline%20graphics.shtml#1ScriptAnchor_)

### Blog Entries

- [Sending email with a huge custom function](https://www.mbsplugins.de/archive/2021-06-26/Sending_email_with_a_huge_cust/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 9.3pr6](https://www.mbsplugins.de/archive/2019-07-17/MBS_FileMaker_Plugin_version_9/monkeybreadsoftware_blog_filemaker)
- [Email Script for FileMaker](https://www.mbsplugins.de/archive/2018-10-10/Email_Script_for_FileMaker/monkeybreadsoftware_blog_filemaker)
- [Sending emails in FileMaker with MBS Plugin](https://www.mbsplugins.de/archive/2016-10-03/Sending_emails_in_FileMaker_wi/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 5.2pr7](https://www.mbsplugins.de/archive/2015-07-16/MBS_FileMaker_Plugin_version_5/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 3.2pr3](https://www.mbsplugins.de/archive/2013-03-05/MBS_Filemaker_Plugin_version_3/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 2.8pr10](https://www.mbsplugins.de/archive/2012-08-01/MBS_Filemaker_Plugin_version_2/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 16th December 2020

  
[CURL.GetHeaders](CURLGetHeaders.md) - [CURL.GetInputLength](CURLGetInputLength.md)

[HTML Version](CURLGetInputAsText.shtml)