Search implementation

def search(self, query, search_type, payload=None):
        '''Search implementation'''
        url = self.url + search_type
        headers = {'User-Agent': self.user_agent}

        if payload is not None:
           payload['Query'] = quote(query)
        else:
            payload = {'Query': quote(query)}

        request = requests.get(url, auth=self.auth, params=payload, headers=headers)
        return request