Add headers to API Request component (#1832)

♻️ (APIRequest.py): refactor APIRequest class to improve variable naming and remove unnecessary underscore prefix in headers parameter
💡 (APIRequest.py): update comments in APIRequest class to improve code readability and maintainability
This commit is contained in:
Cristhian Zanforlin Lousa 2024-05-03 17:26:11 -03:00 • committed by GitHub
commit 566c3642f6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -93,14 +93,14 @@ class APIRequest(CustomComponent):
self, self,
method: str, method: str,
urls: List[str], urls: List[str],
_headers: Optional[Record] = None, headers: Optional[Record] = None,
body: Optional[Record] = None, body: Optional[Record] = None,
timeout: int = 5, timeout: int = 5,
) -> List[Record]: ) -> List[Record]:
if _headers is None: if headers is None:
headers = {} headers = {}
else: else:
headers = _headers.data headers = headers.data
bodies = [] bodies = []
if body: if body: