Questions tagged [http.client]
97 questions
1
vote
1 answer
How can you connect through a SOCKS proxy with python httplib / http.client?
Normally, when using httplib (python 2.x) or http.client (python 3.x), you set up a connection and make a request like so:
from http.client import HTTPConnection
from urllib.parse import urlparse, urlencode
url =…

user3617786
- 121
- 2
- 5
1
vote
1 answer
How to save a file after getting it in a request using http.client
I guess this is kind of a stupid question, but I have tried to search for the answere on google and here with no luck.
So I am connection to a API using a Get request with the http.client package.
The get request is sent to a adress with a ziped…

Siesta
- 451
- 7
- 21
1
vote
2 answers
how to add header and payload info in python http.client methods
Need help for http.client library for doing a PUT request, like to know if there is a way to add header info and payload in the PUT request,
I see documentation says as below, is there a way to embed header and payload info in the BODY? If so,…

Sandeep Shyam
- 123
- 3
- 10
1
vote
2 answers
getting http debug info
I'm going through Dive into Python3. When I get to the chapter on http web services section 14.4, I can't seem to duplicate the following output in the python3 shell. Here's what the sample code looks like:
from http.client import…

William234234
- 515
- 1
- 6
- 15
1
vote
1 answer
http request and regex in Python for HTML parser
When I execute the script, the result is empty. Why? The script connected with a site and parse html tag :
#!/usr/bin/python3
import re
import socket
import urllib, urllib.error
import http.client
import sys
conn =…

faserx
- 317
- 1
- 4
- 17
1
vote
0 answers
Python 3.4: socket.gaierror: [Errno -2] on header request
I need to make a simple header request to every URL in a large set, to check if they are still available. Now I made the following code:
from http import client
for i, triple in enumerate(catalouge):
connection =…

R.P.O.D.
- 81
- 1
- 5
1
vote
1 answer
Selenium Python Ubuntu- Import http.client AttributeError
It's been days i'm fighting with this error.
My background is :
- Clean install of Lubuntu ( based on ubuntu 15 ) w/ just setuptools and selenium 2.50 installed
- A selenium python3 script.
I tried running this script w/ an other machine ( lubuntu…

Joris Heine
- 11
- 2
1
vote
1 answer
read xml files online
i'm new to programing and I'm trying to accese the webservice provided in http://indicadoreseconomicos.bccr.fi.cr/indicadoreseconomicos/WebServices/wsindicadoreseconomicos.asmx?op=ObtenerIndicadoresEconomicosXML, i've added the parameters I need to…

vega2015
- 119
- 3
- 11
0
votes
1 answer
Python: Trying to send a 'application/x-www-form-urlencoded' Post Request but having Config Errors
I have tried every which way to send the below request but I either get a 500 response (Internal Server Error) when I send the book_token in as a string or the below error when I send it in as a…

philip.a20
- 15
- 3
0
votes
1 answer
Mockito (Flutter) can't verify client.post if body is decoded
I'm trying to setup a test for a super simple post request and mockito's "verify" method fails to identify assert that the method was actually called when the body is decoded.
The test runs perfectly fine when both - test and implementation - are…

Pedro Brasil
- 33
- 5
0
votes
0 answers
How to keep HTTP session open with http.client Python Standard Library?
I have a multithreading application that attach a session for each user of my CSV file.
def main():
executor = ThreadPoolExecutor()
futures = [executor.submit(bot.run,
user["login"],
…

Joao Figueiredo
- 60
- 4
0
votes
1 answer
Can you use custom HTTP request methods with http.client?
Is there a way to use HTTP request methods that are not implemented by System.Net.Http.HttpMethod?
I try to update files with a REST interface. The way it is implemented, I GET a list of files and their hashes. Then I check if any of these files…

Skip
- 95
- 8
0
votes
0 answers
OAuth Redirect URI and http.client
I want to connect to an API which is using OAuth 2.0. It requires OAuth Redirect URI which is defined as:
"The URL authenticated OAuth flows for this application should be redirected to."
From this definition, I understand that it should be 'my…

Eren Irmak
- 17
- 6
0
votes
0 answers
How to perform post method with data, proxy and headers, using http client?
I find analogue of:
response = requests.post(url, data=data, verify=False, proxies=Proxy, headers=header_gen())
using http.client lib
conn = http.client.HTTPConnection(url.netloc)
conn.request("POST", url.path, urllib.parse.urlencode({'username':…

middleStackoverflower
- 162
- 7
0
votes
0 answers
Python send connection request to href# returns HTTP 400
There's a href link with # in a website's source code:
Emlak Endeksi
I can send connection request to it's normal link (/path/linktoRealEstate/details) with…

Soul
- 13
- 4