Getting 400 Bad Request despite supplying required parameters
See original GitHub issueHi, I just discovered this package and am trying to use it without much success:
My short script:
const NBA = require('nba');
NBA.stats.scoreboard({GameDate: '03/19/2017'}).then((data) => {
console.log('data = ' + JSON.stringify(data));
}).catch((err) => {
console.log('Error: ' + err);
});
Produces the following error:
$ npm start
> nba-test@1.0.0 start c:\Users\Quasar\Desktop\nba-test
> node index.js
Error: Error: 400 Bad Request - GameDate is required
I looked in the tests and made sure that I was inputting the GameDate parameter correctly, and am still receiving this error. Please help!
Thanks
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
How to Fix a 400 Bad Request Error (Causes and Fixes) - Kinsta
The 400 Bad Request error indicates that the server cannot or process the request due to a client error. Read about the common...
Read more >400 BAD request HTTP error code meaning? - Stack Overflow
A 400 means that the request was malformed. In other words, the data stream sent by the client to the server didn't follow...
Read more >400 Bad Request when creating new contact from form
Solved: I am receiving a 400 bad request when I attempt to submit a HttpClient.PostAsJsonAsync() from my asp.NET MVC web application. I have...
Read more >How to Fix a 400 Bad Request Error: 8 Easy Methods
Most HTTP error 400 bad requests are caused by malformed request syntax, invalid request message framing, or deceptive request routing.
Read more >400 Bad request - Just getting started - Postman community
The 400 (Bad Request) status code indicates that the server cannot or will not process the request because the received syntax is invalid, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Well, the issue is that the
NBA.stats
namespace methods are generated dynamically from a JSON template. I’d like to keep this a thin-as-possible wrapper over the bare HTTP API – which is exactly why I dropped translating request parameters fromjavascriptStyle
toNbaStyle
.Change
GameDate
(capitalized first character) togameDate
(lowercase first character) and it should work. Nearly all the parameters have a capitalized first letter butgameDate
is an exception. There is a note next to the test case forstats.scoreboard
pointing this out: https://github.com/nickb1080/nba/blob/master/test/integration/stats.js#L59