Skip to content

Commit

Permalink
Adds User Agent (#540)
Browse files Browse the repository at this point in the history
* feature/adds-user-agent

* fix circular import
  • Loading branch information
haxdds authored Dec 10, 2021
1 parent e725a0b commit f580737
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions alpaca_trade_api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
__version__ = '1.4.2'

from .rest import REST, TimeFrame, TimeFrameUnit # noqa
from .rest_async import AsyncRest # noqa
from .stream import Stream # noqa
from .stream2 import StreamConn # noqa

__version__ = '1.4.2'
from .stream2 import StreamConn # noqa
2 changes: 2 additions & 0 deletions alpaca_trade_api/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from requests.exceptions import HTTPError
import time
from enum import Enum
from alpaca_trade_api import __version__
from .common import (
get_base_url,
get_data_url,
Expand Down Expand Up @@ -166,6 +167,7 @@ def _request(self,
else:
headers['APCA-API-KEY-ID'] = self._key_id
headers['APCA-API-SECRET-KEY'] = self._secret_key
headers['User-Agent'] = 'APCA-TRADE-SDK-PY/' + __version__
opts = {
'headers': headers,
# Since we allow users to set endpoint URL via env var,
Expand Down

0 comments on commit f580737

Please sign in to comment.