# -*- coding: utf-8 -*-
# Author:w k

from aiohttp import ClientSession
import json as jjson


class Aiorequests(object):
    '''
    把aiohttp 常用2个方法放一起方便调用
    '''
    @staticmethod
    async def get(url, params=None, headers=None, **kwargs):
        async with ClientSession(headers=headers) as session:
            async with session.get(url, params=params, **kwargs) as response:
                try:
                    return jjson.loads(await response.text())
                except:
                    return await response.text()

    @staticmethod
    async def post(url, data=None, json=None, headers=None, **kwargs):
        async with ClientSession(headers=headers) as session:
            async with session.post(url, data=data, json=json, **kwargs) as response:
                try:
                    return jjson.loads(await response.text())
                except Exception as E:
                    return await response.text()





c10e88b9244f60335ce698a995e77bed9bf8efa7
<mask token>

<mask token>


class Aiorequests(object):
    <mask token>

    @staticmethod
    async def get(url, params=None, headers=None, **kwargs):
        async with ClientSession(headers=headers) as session:
            async with session.get(url, params=params, **kwargs) as response:
                try:
                    return jjson.loads(await response.text())
                except:
                    return await response.text()

    @staticmethod
    async def post(url, data=None, json=None, headers=None, **kwargs):
        async with ClientSession(headers=headers) as session:
            async with session.post(url, data=data, json=json, **kwargs
                ) as response:
                try:
                    return jjson.loads(await response.text())
                except Exception as E:
                    return await response.text()

<mask token>


class Aiorequests(object):
    """
    把aiohttp 常用2个方法放一起方便调用
    """

    @staticmethod
    async def get(url, params=None, headers=None, **kwargs):
        async with ClientSession(headers=headers) as session:
            async with session.get(url, params=params, **kwargs) as response:
                try:
                    return jjson.loads(await response.text())
                except:
                    return await response.text()

    @staticmethod
    async def post(url, data=None, json=None, headers=None, **kwargs):
        async with ClientSession(headers=headers) as session:
            async with session.post(url, data=data, json=json, **kwargs
                ) as response:
                try:
                    return jjson.loads(await response.text())
                except Exception as E:
                    return await response.text()

from aiohttp import ClientSession
import json as jjson


class Aiorequests(object):
    """
    把aiohttp 常用2个方法放一起方便调用
    """

    @staticmethod
    async def get(url, params=None, headers=None, **kwargs):
        async with ClientSession(headers=headers) as session:
            async with session.get(url, params=params, **kwargs) as response:
                try:
                    return jjson.loads(await response.text())
                except:
                    return await response.text()

    @staticmethod
    async def post(url, data=None, json=None, headers=None, **kwargs):
        async with ClientSession(headers=headers) as session:
            async with session.post(url, data=data, json=json, **kwargs
                ) as response:
                try:
                    return jjson.loads(await response.text())
                except Exception as E:
                    return await response.text()

# -*- coding: utf-8 -*-
# Author:w k

from aiohttp import ClientSession
import json as jjson


class Aiorequests(object):
    '''
    把aiohttp 常用2个方法放一起方便调用
    '''
    @staticmethod
    async def get(url, params=None, headers=None, **kwargs):
        async with ClientSession(headers=headers) as session:
            async with session.get(url, params=params, **kwargs) as response:
                try:
                    return jjson.loads(await response.text())
                except:
                    return await response.text()

    @staticmethod
    async def post(url, data=None, json=None, headers=None, **kwargs):
        async with ClientSession(headers=headers) as session:
            async with session.post(url, data=data, json=json, **kwargs) as response:
                try:
                    return jjson.loads(await response.text())
                except Exception as E:
                    return await response.text()




