# How to post a dictionary\<string,object\> with a file?

**URL:** <https://community.postman.com/t/how-to-post-a-dictionary-string-object-with-a-file/21194>\
**Category:** Help Hub\
**Created:** [March 10, 2021, 4:07am UTC](https://community.postman.com/t/how-to-post-a-dictionary-string-object-with-a-file/21194 "2021-03-10T04:07:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![garylima](https://avatars.discourse-cdn.com/v4/letter/g/3ab097/32.png) [@garylima](https://community.postman.com/u/garylima)\
**Post date:** [March 10, 2021, 4:07am UTC](https://community.postman.com/t/how-to-post-a-dictionary-string-object-with-a-file/21194/1 "2021-03-10T04:07:17Z")

</div>

Hi There!

I am trying to figure out how to post an object that contains dictionary\<string,object\> to an [ASP.NET](http://ASP.NET) Web API Controller.

**The dictionary\<string,object\> needs to contains a file.**

The endpoint takes an object, so I am trying to figure out how to get this working using **x-www-form-urlencoded** or **raw**.

My endpoint object looks like this:

```
public class PostData
{
    public string EntityName { get; set; }
    public object EntityId { get; set; }
    public string MethodName { get; set; }
    public Dictionary<string, object> Parameters { get; set; }
}

```

I have been trying figure out how to set they keys for dictionaries, can you help out? I need:

A dictionary named “Parameters” to contain:

- FileName = “My file name”
- FileExtension = “zip”
- FileContent = The content of the file

Thank you!

 ![PostmanForum](https://us1.discourse-cdn.com/getpostman/original/3X/6/e/6ef89c2d1dfa1814863942749752a1d30a7c6c25.png)

---

<div class="post-metadata">

**Author:** ![taehoshino](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/taehoshino/32/6608_2.png) [@taehoshino](https://community.postman.com/u/taehoshino)\
**Post date:** [March 11, 2021, 5:03am UTC](https://community.postman.com/t/how-to-post-a-dictionary-string-object-with-a-file/21194/2 "2021-03-11T05:03:08Z")

</div>

Hey @garylima! Welcome to the Postman community 🚀

I understand you would like to post object/dictionary to your endpoint.

Can you use raw body with JSON type like below?

 ![Screen Shot 2021-03-11 at 4.02.34 pm](https://us1.discourse-cdn.com/getpostman/original/3X/b/9/b9257b652bfbbfa136323d3881c838a28016dcb5.png)

Please let me know if that works 😃

---

<div class="post-metadata">

**Author:** ![aerospace-cosmologi7](https://avatars.discourse-cdn.com/v4/letter/a/ed655f/32.png) [@aerospace-cosmologi7](https://community.postman.com/u/aerospace-cosmologi7)\
**Post date:** [July 8, 2022, 9:46am UTC](https://community.postman.com/t/how-to-post-a-dictionary-string-object-with-a-file/21194/3 "2022-07-08T09:46:38Z")

</div>

Hey @taehoshino I have same object type data but I’m including file type data and its throwing error, can you please suggest how to generate form data for that one?

 ![image](https://us1.discourse-cdn.com/getpostman/original/2X/2/27243dde9960b88e87586027af276a2f7c5b6123.png)
