MCPcopy Index your code
hub / github.com/blacklanternsecurity/bbot / prepare_api_request

Method prepare_api_request

bbot/modules/base.py:1250–1259  ·  view source on GitHub ↗

Prepare an API request by adding the necessary authentication - header, bearer token, etc.

(self, url, kwargs)

Source from the content-addressed store, hash-verified

1248 yield line
1249
1250 def prepare_api_request(self, url, kwargs):
1251 """
1252 Prepare an API request by adding the necessary authentication - header, bearer token, etc.
1253 """
1254 if self.api_key:
1255 url = url.format(api_key=self.api_key)
1256 if "headers" not in kwargs:
1257 kwargs["headers"] = {}
1258 kwargs["headers"]["Authorization"] = f"Bearer {self.api_key}"
1259 return url, kwargs
1260
1261 async def api_request(self, *args, **kwargs):
1262 """

Callers 2

api_requestMethod · 0.95
api_downloadMethod · 0.95

Calls 1

formatMethod · 0.45

Tested by

no test coverage detected