create any object in kubernetes based on URL

def _kpost(url, data):
    ''' create any object in kubernetes based on URL '''

    # Prepare headers
    headers = {"Content-Type": "application/json"}
    # Make request
    log.trace("url is: %s, data is: %s", url, data)
    ret = http.query(url,
                     method='POST',
                     header_dict=headers,
                     data=salt.utils.json.dumps(data))
    # Check requests status
    if ret.get('error'):
        return ret
    else:
        return salt.utils.json.loads(ret.get('body'))