POST a JSON to and API

Hello Folks,

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

{   "input": "http://www.example.com/input/video.mov",   "output": [     {       "base_url": "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? 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!