question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

res.getHeader() method not found

See original GitHub issue

scripting.md contains code that retrieves response headers via method res.getHeader()

robot.http("https://midnight-train")
  .get() (err, res, body) ->
...
rateLimitRemaining = parseInt res.getHeader('X-RateLimit-Limit') if res.getHeader('X-RateLimit-Limit')

but this throws runtime error :

ERROR TypeError: Object #<IncomingMessage> has no method ‘getHeader’

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
derekriemercommented, Jul 9, 2017

the docs at https://hubot.github.com/docs/scripting/ still use this old method.

0reactions
WOLVIE97commented, Nov 8, 2017
Read more comments on GitHub >

github_iconTop Results From Across the Web

res.getHeader function does not exist · Issue #117 · pillarjs/send
I'm wondering if this module is not up to date? ... States: res.set('Content-Type', 'text/html'); . Same goes for koajs. Can't see any getHeader...
Read more >
Change res.getHeader() to res.get() - node.js - Stack Overflow
Yes or better: req.header('Content-Type') . See footer here.
Read more >
Why request.getHeader doesn't work on request object on ...
Hello. I've been playing with NodeJS and reading, and probably I'm missing something. As I learned, it is possible to use ClientRequest ......
Read more >
getHeaders JavaScript and Node.js code examples - Tabnine
Best JavaScript code snippets using getHeaders(Showing top 15 results out of 315) ; function getSafeHeaders(res) { · res.getHeaders ? res.getHeaders() : res.
Read more >
apex - Unable to get request header details
If you explicitly want to log/print header you will have to call getHeader() method. For ex: System.debug('>> Authorization' + req.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found