Questions tagged [http.client]
97 questions
1
vote
1 answer
Calling C# DLL http.client.GetAsync(uri) with await causes SEHException
I'm calling c# dll unmanaged methods from a different language. I have callback set so my app gets results thru it when c# dll is done.
This causes SEHException on .Invoke:
public static async Task> Fetch2(Uri uri)
{
…

Bostjan Laba
- 23
- 5
1
vote
0 answers
Getting "SSL: WRONG_VERSION_NUMBER" on Proxied Get Request with http.client in Python
I am attempting to send a proxied post request with http.client, and I am getting SSL: WRONG_VERSION_NUMBER error.
Below is my current code:
r = http.client.HTTPSConnection("IP:PORT")
r.request('GET', f"http://httpbin.org/get" , headers={"host":…

Rubs 01
- 11
- 1
1
vote
2 answers
Locust - Python - ssl.SSLError: [SSL] PEM lib (_ssl.c:4065)
I am new to python and locust, trying to run my first locust perf script to test an API
However, I am getting error as ssl.SSLError: [SSL] PEM lib (_ssl.c:4065)
for following code.
class MyHttpTest(HttpUser):
wait_time = constant(5)
host =…

Ajay
- 43
- 1
- 7
1
vote
1 answer
Setting newer ssl version in python http.client.HTTPSConnection
I've got this following https client that attempt to send simple POST request to a remove server.
!/usr/bin/python3
import http.client
import json
import ssl
context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
connection =…

Zohar81
- 4,554
- 5
- 29
- 82
1
vote
2 answers
Angular 8 http patch completing succesfully but not providing correct response first time
I have an http patch call in a function in a service in Angular 8:
// public returnStr: string = ""; at top of service
updateResponse(response: Response, reviewId: number): string {
this.http.patch(`/assessing/api/reviews/update/${reviewId}`,…

anvw
- 149
- 3
- 15
1
vote
1 answer
Nonetype on API call
using http.client to export survey responses from Qualtrics. In order to get my survey responses I required the progress Id... when I create the data export I am able to see the result of it but get NoneType error when trying to get the value I…

pdangelo4
- 220
- 4
- 17
1
vote
1 answer
How to correct ModuleNotFoundError for http.client
I am trying to use the urllib library as part of a python program for web scraping. It contains the module request.py which has to import http.client. However I keep on getting this message:
ModuleNotFoundError: No module named 'http.client'; 'http'…

Paulina Mensah
- 13
- 1
- 4
1
vote
2 answers
How to apply proxy with authentication using http.client for API
I'm attempting to use Bing's Entity search API, however I need to go through a proxy in order to establish a connection.
My company has giving me a proxy in the following format to use:…

mikelowry
- 1,307
- 4
- 21
- 43
1
vote
0 answers
HTTP POST with Json on Body - Flutter/Dart, The response is empty
I am making an api call to my server via my flutter app,This is my code to make a request to an API:
import 'dart:convert';
import 'dart:io';
import 'package:flutter/cupertino.dart';
import 'package:flutterbutyle/models/models.dart';
import…

Pegah Ahmadvand
- 97
- 2
- 10
1
vote
2 answers
http.client.InvalidURL: nonnumeric port: '//water-lined.net' Error?
I've been trying to make a script to check if a random website exists and then opens it if it does exist, but I keep getting a bunch of different errors. Here is my code:
import webbrowser
import time
import random
import http.client
from…

Ge1p
- 35
- 2
- 7
1
vote
1 answer
How can I unshorten a URL in python 3
import http.client
import urllib.parse
def unshorten_url(url):
parsed = urllib.parse.urlparse(url)
h = http.client.HTTPConnection(parsed.netloc)
resource = parsed.path
if parsed.query != "":
resource += "?" + parsed.query
…
1
vote
1 answer
Python msfrpc works with python2, throws authentication error with python 3
I'm writing a web app using python flask and python3, and would like to use the metasploit API. When writing code with python2, everything works as it should (as the lib was written for python2). However, when attempting to use it in python 3, i'm…

juddev
- 11
- 1
1
vote
0 answers
http.client.RemoteDisconnected: Remote end closed connection without response
I am using the http.client module to download files from an apache server.
Basically each thread is downloading files from the server. But when there are a large number of threads running I seem to be facing a problem where some threads get…

Siddharth Sampath
- 135
- 3
- 14
1
vote
1 answer
request.context won't close connection
I'm using context.Context to cancel a http request
I find although I got the "context cancel", the underlying socket connection is still available, and I can get the response after a few seconds. Is it designed this way to read response once request…

isaac
- 15
- 1
- 6
1
vote
0 answers
Error running a Python script on the web via PHP
I'm facing a not understandable error when I'm launching my Python script on my ftp server via PHP, which is the following:
Traceback (most recent call last):
File "./data.py", line 9, in import urllib.request
File…

sammtt
- 401
- 1
- 6
- 14