POST a JSON to and API

Hello Folks,

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

{   "input": "",   "output": [     {       "base_url": "",       "filename": "video.mp4",       "thumbnails": {         "number": 1,         "size": "86x66"       }     }   ] }

What's the best way to post this JSON to an API, e.g. How should I create a function that will take an input file name ( and output a JSON object as well as POST it to an API?