Skip to content

Commit 148b67a

Browse files
Pass API key as header value and no longer as query parameter
1 parent ca53a7e commit 148b67a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ipregistry/request.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def origin_lookup_ip(self, options):
4343
pass
4444

4545
def _build_base_url(self, ip, options):
46-
result = self._config.base_url + "/" + ip + "?key=" + self._config.api_key
46+
result = self._config.base_url + "/" + ip
4747

4848
for key, value in options.items():
4949
if isinstance(value, bool):
@@ -135,9 +135,9 @@ def __create_api_error(response):
135135
else:
136136
raise ClientError("HTTP Error occurred, but no response was received.")
137137

138-
@staticmethod
139-
def __headers():
138+
def __headers(self):
140139
return {
140+
"authorization": "ApiKey " + self._config.api_key,
141141
"content-type": "application/json",
142142
"user-agent": "Ipregistry/Python" + str(sys.version_info[0]) + "/" + __version__
143143
}

0 commit comments

Comments
 (0)