python-requests Questions

3

Solved

I am using the Python requests module to send a multi-part HTTP POST request that contains both form-data and a file attachment. The "Content-disposition" header for each multi-part object is set...
Forgery asked 25/8, 2019 at 8:37

4

Solved

I have a simple flask server defined like so: import sys import flask from flask import request app = flask.Flask(__name__) port = 4057 @app.route('/search', methods=['POST']) def search(): re...
Laager asked 12/12, 2017 at 5:55

5

I am trying to install the requests package for Python 3.7 on Mac. I already have python 2.7 installed. I have read all the previous questions related to this and none of them could solve the issue...
Doodle asked 19/2, 2020 at 21:19

9

Solved

url = 'https://query2.finance.yahoo.com/v7/finance/quote?symbols=TSLA&fields=regularMarketPreviousClose&region=US&lang=en-US' headers = { 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64)...
Briannabrianne asked 20/4, 2023 at 14:7

2

Solved

I'm building a wrapper for an API. For now, it works. However, it is synchronous, using the requests module for HTTP calls. I would like to implement a way to asynchronously call these methods wh...
Crossfertilization asked 22/9, 2018 at 17:30

5

Solved

I'm using the Python requests package to send http requests. I want to add a single proxy to the requests session object. eg. session = requests.Session() session.proxies = {...} # Here I want to ...
Grimbly asked 15/6, 2015 at 5:22

8

Solved

I'm trying to GET an URL of the following format using requests.get() in python: http://api.example.com/export/?format=json&key=site:dummy+type:example+group:wheel #!/usr/local/bin/python im...
Variable asked 6/5, 2014 at 13:55

16

Solved

I'm scraping some internal pages using Python and requests. I've turned off SSL verifications and warnings. requests.packages.urllib3.disable_warnings() page = requests.get(url, verify=False) O...
Halloween asked 24/6, 2016 at 14:13

2

Solved

When requesting a web resource or website or web service with the requests library, the request takes a long time to complete. The code looks similar to the following: import requests requests.get(...
Mireyamiriam asked 26/6, 2020 at 16:28

6

Solved

Currently we're using an approach of putting CA Certificates on the server to access third party APIs. certificate_path = os.path.join(CERT_PATH, 'cacert.pem') certificate_key_path = os.path.join(...
Sedimentary asked 31/7, 2017 at 8:11

2

Solved

I have a simple python telegram bot, here's the code: import requests import json from time import sleep import os filename = 'bot_last_update' target = open(filename, 'r') update_from_file = tar...
Gwen asked 9/6, 2017 at 3:2

4

Solved

It seems that when a key in data has a value of None, the key isn't included by requests. >>> req = requests.Request('POST', 'http://google.com', data=dict(a=None, b=1)) >>> req....
Skeie asked 28/3, 2016 at 21:40

4

I am experimenting with the GPT API by OpenAI and am learning how to use the GPT-3.5-Turbo model. I found a quickstart example on the web: def generate_chat_completion(messages, model="gpt-3.5...
Benighted asked 16/4, 2023 at 3:42

3

I am using an API, which receives a pdf file and does some analysis, but I am receiving Response 500 always Have initially tested using Postman and the request goes through, receiving response 200...
Pileum asked 20/6, 2019 at 9:46

6

Solved

When importing requests in python3, I'm getting the following error: Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) [MSC v.1914 32 bit (Intel)] on win32 Type "help", "copyright", "credits...
Collimate asked 9/8, 2018 at 20:42

11

The Python requests module provides good documentation on how to upload a single file in a single request: files = {'file': open('report.xls', 'rb')} I tried extending that example by using thi...
Coopt asked 12/8, 2013 at 3:57

5

My question is closely related to this one. I'm using the Requests library to hit an HTTP endpoint. I want to check if the response is a success. I am currently doing this: r = requests.get(url)...
Planchette asked 6/11, 2017 at 19:46

1

I'm running a dev uwsgi server using flask and a call to requests.get is triggering a segmentation fault in the uWSGI process. Segmentation Fault: !!! uWSGI process 70490 got Segmentation Fault !...
Hagerty asked 26/2, 2016 at 11:28

5

Solved

Python version: 3.9.1 I trying to write bot that send requests and it work perfectly fine, the only issue that i have is when i trying to use web debugging programs such as Charles 4.6.1 or Fiddler...
Dagmar asked 31/12, 2020 at 3:36

5

I'm using Flask-uploads to upload files to my Flask server. The max size allowed is set by using flaskext.uploads.patch_request_class(app, 16 * 1024 * 1024). My client application (A unit test) us...
Ornithic asked 18/10, 2013 at 21:20

11

Solved

I'm on Ubuntu 12.10 with OpenSSL 1.0.1c, python 2.7.3, Requests 1.0.3 and 1.0.4 (tried both), and when attempting to connect to the website in the url variable with the following code. def SendIni...
Substratosphere asked 31/12, 2012 at 13:51

2

The certifi library often runs into issues with domain certificates, but in the standard urllib.request library has no issue. If I set the context to use the certifi's file, I get the SSL error, im...
Mccarver asked 25/9, 2020 at 11:26

7

Solved

I'm using requests to access a RESTful API. Everything seems to work. I can authenticate, pull back a session token and even unit test the methods in my class I wrote for the API. Then I tried to r...
Marleah asked 17/7, 2018 at 22:23

1

Solved

I attempted the following: Utilize the German stock exchange's API (https://api.boerse-frankfurt.de/v1/search/equity_search) to retrieve index values. The API can be accessed externally using para...
Occidentalize asked 10/4, 2024 at 20:59

37

I tried importing requests: import requests But I get an error: ImportError: No module named requests
Primacy asked 25/6, 2013 at 23:34

© 2022 - 2025 — McMap. All rights reserved.