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.

How to get date and URI from response object's headers?

See original GitHub issue

Newbie question here, I am only able to get content-type and content-length in response HTTP headers. I also want date and URI. How do I do that? Please help me out. Thank You

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
tomchristiecommented, Nov 14, 2019

I can’t provide the time to help you out on this, but I think it’s the request you want to verify here, not the response. You can access the request date header from request.headers[“Date”] and the URL with request.url.

1reaction
tomchristiecommented, Nov 13, 2019

The Date: HTTP header will be added by the webserver, rather than at the application level. It’s not available in application code. (What are you attempting to use it for?)

I’m not sure which URI you mean? The URL for the incoming request? The URL in the Location: header of a redirect response? Something else?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting Date from http header response - Stack Overflow
$.ajax({ url: url, type: "GET", contentType: "application/json; ...
Read more >
Response.headers - Web APIs | MDN
The headers read-only property of the Response interface contains the Headers object associated with the response.
Read more >
Advanced HTTP networking - Apollo GraphQL Docs
For example, you can set the headers field on the context to pass custom headers for a particular operation. The context also supports...
Read more >
response.headers - Python requests - GeeksforGeeks
Whenever we make a request to a specified URI through Python, it returns a response object. Now, this response object would be used...
Read more >
Request and response objects - Django documentation
A dictionary of key/value parameters included in the CONTENT_TYPE header. HttpRequest. GET ¶. A dictionary-like object containing all given HTTP GET parameters.
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