def do_post(url, payload, dry_run=False):
    '\n    Do a POST request with Requests, return the status code.\n\n    :param url: URL to POST to\n    :type nm_host: string\n    :param payload: the payload data, to be JSON encoded\n    :type name: dict\n    :param dry_run: if True, only print what would be done, do not make any changes\n    :type dry_run: boolean\n    :returns: HTTP status code from the request\n    :rtype: int\n    '
    headers = {'content-type': 'application/json'}
    if dry_run:
        logger.warning(('DRY RUN: do_post to url %s - payload:\n\t%s\n' % (url, payload)))
        return 201
    r = requests.post(url, data=anyjson.serialize(payload), headers=headers)
    return r.status_code
Do a POST request with Requests, return the status code.

:param url: URL to POST to
:type nm_host: string
:param payload: the payload data, to be JSON encoded
:type name: dict
:param dry_run: if True, only print what would be done, do not make any changes
:type dry_run: boolean
:returns: HTTP status code from the request
:rtype: int
def do_post(url, payload, dry_run=False):
    '\n    Do a POST request with Requests, return the status code.\n\n    :param url: URL to POST to\n    :type nm_host: string\n    :param payload: the payload data, to be JSON encoded\n    :type name: dict\n    :param dry_run: if True, only print what would be done, do not make any changes\n    :type dry_run: boolean\n    :returns: HTTP status code from the request\n    :rtype: int\n    '
    headers = {'content-type': 'application/json'}
    if dry_run:
        logger.warning(('DRY RUN: do_post to url %s - payload:\n\t%s\n' % (url, payload)))
        return 201
    r = requests.post(url, data=anyjson.serialize(payload), headers=headers)
    return r.status_code