alpacahq / alpaca-ts

A TypeScript Node.js library for the https://alpaca.markets REST API and WebSocket streams.
ISC License
156 stars 41 forks source link

PUT requests don't work #70

Closed xanoinc closed 3 years ago

xanoinc commented 3 years ago

Description PUT requests appear to be broken.

Trying to use client.updateWatchlist complains about a malformed request.

It looks like there is a conditional in the request method that needs to be updated

CURRENT: if (params.method != 'POST' && params.method != 'PATCH') { CHANGE TO: if (!['POST','PATCH','PUT'].includes(params.method)) {

Expected A clear and concise description of what you expected to happen.

The watchlist should get updated properly.

Reproduction Steps we can take to reproduce the bug:

Just try using client.updateWatchlist and it will generate an error from the server due to a malformed request.

Logs If applicable, add logs to help explain the bug.

Additional Add any other context about the problem here.

117 commented 3 years ago

Thank you for finding the issue.