import requests

UA = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 ' \
     'Safari/537.36 '


def http_get(url):
    headers = {'User-Agent': UA}
    rsp = requests.get(url, proxies={'http': '', 'https': ''}, headers=headers)
    return rsp


def form_post(url, data, headers=None):
    if headers:
        rsp = requests.post(url, data=data, headers=headers)
    else:
        rsp = requests.post(url, data=data, headers={'User-Agent': UA})
    return rsp


def json_post(url, data, headers=None):
    if headers:
        rsp = requests.post(url, json=data, headers=headers)
    else:
        rsp = requests.post(url, json=data, headers={'User-Agent': UA})
    return rsp
