mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 03:34:15 +02:00
[wgem] downloading suggestions from the cloud and generating a search index
This commit is contained in:
@@ -3,6 +3,7 @@ import time
|
||||
import traceback
|
||||
|
||||
import requests
|
||||
import yaml
|
||||
|
||||
from bauh.commons import system
|
||||
|
||||
@@ -59,6 +60,10 @@ class HttpClient:
|
||||
res = self.get(url, params=params, headers=headers, allow_redirects=allow_redirects)
|
||||
return res.json() if res else None
|
||||
|
||||
def get_yaml(self, url: str, params: dict = None, headers: dict = None, allow_redirects: bool = True):
|
||||
res = self.get(url, params=params, headers=headers, allow_redirects=allow_redirects)
|
||||
return yaml.safe_load(res.text) if res else None
|
||||
|
||||
def get_content_length(self, url: str) -> str:
|
||||
"""
|
||||
:param url:
|
||||
|
||||
Reference in New Issue
Block a user