# POST a JSON to and API

**URL:** <https://www.ruby-forum.com/t/post-a-json-to-and-api/187658>\
**Category:** Rails\
**Created:** [April 27, 2010, 2:34pm UTC](https://www.ruby-forum.com/t/post-a-json-to-and-api/187658 "2010-04-27T14:34:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![face7hill](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/e480ec/32.png) [@face7hill](https://www.ruby-forum.com/u/face7hill)\
**Post date:** [April 27, 2010, 2:34pm UTC](https://www.ruby-forum.com/t/post-a-json-to-and-api/187658/1 "2010-04-27T14:34:05Z")

</div>

Hello Folks,

I’m trying to POST a JSON object to an API:

{  
“input”: “[http://www.example.com/input/video.mov](http://www.example.com/input/video.mov)”,  
“output”: [  
{  
“base\_url”: “[http://www.example.com/output/](http://www.example.com/output/)”,  
“filename”: “video.mp4”,  
“thumbnails”: {  
“number”: 1,  
“size”: “86x66”  
}  
}  
]  
}

What’s the best way to post this JSON to an API, e.g.  
[http://www.example.com/api](http://www.example.com/api)?  
How should I create a function that will take an input file name  
(video.mov) and output a JSON object as well as POST it to an API?

Thanks!
