Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8215991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T11:58:37+00:00 2026-06-07T11:58:37+00:00

I am trying to connect to a webpage using urllib3. The code is provided

  • 0

I am trying to connect to a webpage using urllib3. The code is provided below.

import urllib3
http=urllib3.PoolManager()
fields={'username':'abc','password':'xyz'}
r=http.request('GET',url,fields)

If we assume that url is some webpage which needs to be authenticated using username and password, am i using the right code to authenticate ?

I have did this using urllib2 very comfortably but i was not able to do the same thing using urllib3.

Many Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T11:58:40+00:00Added an answer on June 7, 2026 at 11:58 am

    Assuming you’re trying to do Basic Authentication, then you need to put the username and password encoded in an Authorization header. Here’s one way to do that using the urllib3.make_headers helper:

    import urllib3
    
    http = urllib3.PoolManager()
    url = '...'
    headers = urllib3.make_headers(basic_auth='abc:xyz')
    r = http.request('GET', url, headers=headers)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to connect to a MySQL Server using JDBC tool in java
I'm trying to connect to a FTP using Apaches FTPSClient but I keep getting
I've been trying to connect to my own site using both CURL and the
I'm trying to connect to a webpage and get some info and images off
I am trying to connect to twitter via TwitterVB and the following code does
Ok I am trying to connect to an Outlook calendar from C# using the
I am trying to send a http request to a neo4j database using node.js.
I am trying to find all the broken links in the webpage using Java.
I'm using HostMonster as my web host and I'm trying connect to a database
I'm trying to connect to a server using https and when I do it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.