import requests
import json


def read_json_post(file, headers, request_json):
    """Read JSON from a local file or a URL POST"""
    if file.startswith("http"):
        r = requests.post(file, headers=headers, json=request_json)
        return r.json()
    else:
        with open(file) as f:
            return json.load(f)