Skip to main content
4 votes

How can I implement a method to call the SE API that handles backoff correctly?

I think a simple singleton that keeps track of the backoff should be enough. I assume you do use the fetch API or any other async capable module. But the approach is also feasible with just Promises ...
rene's user avatar
  • 2,662
3 votes
Accepted

When I perform an API call via browser, it displays pretty JSON. How come when I do the same request via nodejs in my console it is garbled?

I've been bitten by this feature as well in the past... Responses from the API are compressed with GZIP (by default; you can request DEFLATE as well). Your browser automatically knows how to handle ...
Glorfindel's user avatar
  • 6,792
2 votes

How do I actually begin to code, in Node, using the Stack Exchange API?

There is an example of how to invoke the constructor here: // app/src/resolvers.js const stackexchange = require('stackexchange-node'); const config = require('../config/config'); const options = {...
Paul Sweatte's user avatar
2 votes
Accepted

Getting 405 when trying to post a comment

The problem was the fact that I was using the http module, rather than https. Since its protocol is https, I have to use the https module const https = require("https") const data = `site=...
MrMythical's user avatar
2 votes

Generate Headers - a utility package for validating and auto generating userscript manager headers

feature-request I would like an option to have the generator expand a single match argument to all known Stack Exchange domains. So for example -m "https://*.stackexchange.com/reviews/*" -...
rene's user avatar
  • 2,662
1 vote

Generate Headers - a utility package for validating and auto generating userscript manager headers

feature-request The package.json needs to exist and the required properties need to have a value. While it is documented it is easily overlooked. My use case is slightly different. I wanted to ...
rene's user avatar
  • 2,662

Only top scored, non community-wiki answers of a minimum length are eligible