(method, url, headers, data=None, binary=False)
return response_data
Wrapper for HTTP request

    Parameters
    ----------
    method : str
        HTTP method. One of GET, PUT, POST or DELETE
    url : str
        URL for the request
    headers: dict
        HTTP header information
    data: dict
        Figshare article data
    binary: bool
        Whether data is binary or not

    Returns
    -------
    response_data: dict
        JSON response for the request returned as python dict
Wrapper for HTTP request
Wrapper for HTTP request
def fs_issue_request(method, url, headers, data=None, binary=False):
    """Wrapper for HTTP request

    Parameters
    ----------
    method : str
        HTTP method. One of GET, PUT, POST or DELETE
    url : str
        URL for the request
    headers: dict
        HTTP header information
    data: dict
        Figshare article data
    binary: bool
        Whether data is binary or not

    Returns
    -------
    response_data: dict
        JSON response for the request returned as python dict
    """
    if data is not None and not binary:
        data = json.dumps(data)

    response = requests.request(method, url, headers=headers, data=data)

    try:
        response.raise_for_status()
        try:
            response_data = json.loads(response.text)
        except ValueError:
            response_data = response.content
    except HTTPError as error:
        print("Caught an HTTPError: {}".format(error))
        print("Body:\n", response.text)
        raise

    return response_data
def fs_issue_request ( method , url , headers , data = None , binary = False ) : if data is not None and not binary : data = json . dumps ( data ) response = requests . request ( method , url , headers = headers , data = data ) try : response . raise_for_status ( ) try : response_data = json . loads ( response . text ) except ValueError : response_data = response . content except HTTPError as error : print ( "Caught an HTTPError: {}" . format ( error ) ) print ( "Body:\n" , response . text ) raise return response_data