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.

Optional base url attribute on Session object

See original GitHub issue

Is it possible to add an optional base url attribute to the Session object ?

For example;

 auth = ('user', 'pass')
 with requests.session(url='http://api.twitter.com', auth=auth) as s:
     resp = s.get('/1/statuses/home_timeline.json')

Issue Analytics

  • State:closed
  • Created 12 years ago
  • Reactions:12
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
kennethreitzcommented, Aug 23, 2011

I’ve considered this myself, but opted against it. I think this is a good use-case for the hooks.

1reaction
tbackcommented, Aug 20, 2019

I don’t think this can be done with hooks anymore.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Optional base url attribute on Session object #133 - GitHub
Is it possible to add an optional base url attribute to the Session object ? For example;. auth = ('user', 'pass') with requests.session(url=' ......
Read more >
Advanced Usage — Requests 2.28.1 documentation
The Session object allows you to persist certain parameters across requests. It also persists cookies across all requests made from the Session instance, ......
Read more >
class Requests_Session {} - WordPress Developer Resources
Allows various options to be set as default values, and merges both the options and URL properties together. A base URL can be...
Read more >
Session Attributes in Spring MVC - Baeldung
Explore the different ways to store attributes in a session with Spring MVC. ... TodoItem to the TodoList and redirecting to the list...
Read more >
How to use Session attributes in Spring-mvc - Stack Overflow
SessionAttribute annotation is the simplest and straight forward instead of getting session from request object and setting attribute.
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