WebRequest.GetBodyAsContainer
-----------------------------

Queries body for HTTP request as container.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [WebHook](component_WebHook.md) | [11.5](newinversion115.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "WebRequest.GetBodyAsContainer"; WebRequest { ; FileName } ) 

**MBS**( **"WebRequest.GetBodyAsContainer";** /\* Queries body for HTTP request as container. \*/  
**$WebRequest**; /\* The reference number of the web request. \*/   
**$FileName**) /\* Optional; The file name to use for container.  
Also defines the type of container value.  
We try to get it from the URL usually.e.g. "test.pdf" \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| WebRequest | The reference number of the web request. | $WebRequest |  |
| FileName | The file name to use for container.   Also defines the type of container value.   We try to get it from the URL usually. | "test.pdf" | Optional |

### Result

Returns container value or error.

### Description

Queries body for HTTP request as container.  
If the user sent a picture, PDF or other files, you may just query them as container value.  
  
e.g. in Terminal upload a picture to grab it with this function:  
curl --upload-file /path/Pictures/cat.jpg -v http://localhost:9999/cat.jpg  
### Examples

Reads body as container:

 Set Field \[ WebHook::Container ; MBS ("WebRequest.GetBodyAsContainer"; $WebRequest ) \]  
### See also

- [WebRequest.GetBody](WebRequestGetBody.md)

This function is free to use.

Created 24th October 2021 , last changed 9th November 2021

  
[WebRequest.GetBody](WebRequestGetBody.md) - [WebRequest.GetBodySize](WebRequestGetBodySize.md)

[HTML Version](WebRequestGetBodyAsContainer.shtml)