Skip to content
This repository has been archived by the owner on May 29, 2021. It is now read-only.

Latest commit

 

History

History

headers

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Skip to API reference -->

See Examples in Code

Headers

wstrade-api handles the network-level protocol for talking to Wealthsimple Trade endpoints without any necessary intervention from you. However, in rogue usecases that I cannot think of, you might need to override this with custom headers.

The headers module provides you with extensibility to configure custom HTTP headers on all endpoint calls to Wealthsimple Trade. 99.9% of wstrade-api users won't be using this module at all. However, it is still useful to know about its existence.

The headers module could act as insurance in events where Wealthsimple Trade starts to require a certain header to be present that is not available in an older version of wstrade-api, for example.

API Reference


headers.add

headers.add(name, value) -> void

Appends a custom key-value header to all endpoint requests to Wealthsimple Trade.


headers.remove

headers.remove(name) -> void

Removes a custom header that was previously added with headers.add.

See also: headers.add


headers.clear

headers.clear() -> void

Removes all custom headers.


headers.values

headers.values() -> Array<String>

Returns a list of all custom key-value headers.