# Support looking up binary files as HTTP-based APIs are increasingly supporting uploading of BASE64 encoded binaries in JSON documents.

**URL:** <https://forum.ansible.com/t/support-looking-up-binary-files-as-http-based-apis-are-increasingly-supporting-uploading-of-base64-encoded-binaries-in-json-documents/25540>\
**Category:** Ansible Project\
**Created:** [September 20, 2017, 1:50am UTC](https://forum.ansible.com/t/support-looking-up-binary-files-as-http-based-apis-are-increasingly-supporting-uploading-of-base64-encoded-binaries-in-json-documents/25540 "2017-09-20T01:50:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Behrang](https://avatars.discourse-cdn.com/v4/letter/b/ed655f/32.png) [@Behrang](https://forum.ansible.com/u/Behrang)\
**Post date:** [September 20, 2017, 1:50am UTC](https://forum.ansible.com/t/support-looking-up-binary-files-as-http-based-apis-are-increasingly-supporting-uploading-of-base64-encoded-binaries-in-json-documents/25540/1 "2017-09-20T01:50:59Z")

</div>

Hi,

This is in regards to [#11594](https://github.com/ansible/ansible/issues/11594). Many APIs these days allow embedding BASE64 encoded binary data in JSON documents. Here’s an [example](https://docs.databricks.com/api/latest/workspace.html#import) from Databricks, wherein the “content” field can contain BASE64 encoded binary data:

```auto
{
  "content": "MSsx\n",
  "path": "/Users/user@example.com/project/ScalaExampleNotebook",
  "language": "SCALA",
  "overwrite": true,
  "format": "SOURCE"
}

```

The lookup command cannot load binary files though. Consequently, we need to use `command` and `curl` in our Ansible playbooks.

Any plans to allow embedding BASE64-encoded binaries in JSON payloads when using the `uri` module?

Thanks in advance,  
Behrang

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [September 20, 2017, 2:29am UTC](https://forum.ansible.com/t/support-looking-up-binary-files-as-http-based-apis-are-increasingly-supporting-uploading-of-base64-encoded-binaries-in-json-documents/25540/2 "2017-09-20T02:29:25Z")

</div>

Use the slurp task. lookups cannot do this because they are part of  
Jinja2 templating.
