22,021 questions
Best practices
1
vote
8
replies
92
views
Check if request.json() is NoneType
I am making API Calls and expect to get some null responses or NoneTypes. However I am trying to handle them gracefully.
This is the default behavior:
res = req.json()
res.get("key", {})....
0
votes
0
answers
31
views
REST API request succeeds via cURL but fails with 500 Internal Server Error when sent from Python (requests) inside ERPNext (Frappe)
I’m integrating ERPNext (Frappe Framework) with the Pakistan FBR DI API.
I’m facing a strange issue:
When I send the request using cURL, the invoice is accepted successfully.
When I send the exact ...
0
votes
1
answer
99
views
Loading images in HTML – Differentiation between no response and error response
I'm building a kind of gallery app. Users are adding images by inserting URLs into the database and the HTML page is then hotlinking those. Obviously, because of link rotting, the gallery is full of ...
1
vote
1
answer
98
views
HTTP Request to a Specific Website Fails with "Connection Timed Out" in Code, but Works in Browser
I'm encountering a consistent
Connection timed out
error when my application, running on a local development server, tries to make HTTP requests to a specific external website. The site loads ...
Best practices
1
vote
3
replies
88
views
Best Practice for Certificate Authentication
If I need to authenticate with a certificate, I have a few options available:
Add the certificate to the bundle packaged with requests/certifi
Add the certificate to the system store and override ...
0
votes
0
answers
63
views
GitHub API endpoint no longer returning results for referral sources
When querying the referral sources endpoint on GitHub I'm only getting an empty list returned. I can get data for other endpoints in the same repo, even for other traffic endpoints. I'm expecting ...
3
votes
3
answers
115
views
Python requests.request returning garbage
Calling an api. For almost all calls the response comes clean but for a few there is garbage in the returned json. Executing the garbage one in the Firefox browser with the same parameters returns ...
0
votes
1
answer
72
views
Using HTTPkerberosauth with a javascript enabled web scraper
I'm working on integration tests for a web application that's running in a Docker container within our GitLab CI/CD pipeline. The application is a frontend that requires Kerberos/SPNEGO authentication ...
-2
votes
0
answers
55
views
Error message when scraping mutliple movies via bs4 [duplicate]
The Python code:
from bs4 import BeautifulSoup
import requests
#####################################################
# Extracting the links of multiple movie transcripts
##############################...
1
vote
0
answers
51
views
Connection management while maintaining requests.Session
What I found
While using the requests library for HTTP requests, I noticed that there were many TCP connections in the FIN_WAIT2 state on the server. Through code analysis, I found that these ...
0
votes
1
answer
155
views
POST requests from Cloud Run arriving as GET requests in my Django REST API
I have a serverless pipeline on Google Cloud. It consists of three total steps:
A video uploader that sends videos to Google Cloud Storage. Working fine.
An eventarc + pub/sub trigger that fires ...
3
votes
1
answer
90
views
Unable to post large file with python requests library
I try to post large file and read response as streaming with requests python library.
I have to send a large text file (2 million lines of log ) and receive response back as streaming. If I did by ...
0
votes
0
answers
80
views
python request getting different result than postman
I am attempting to improve my python by working on a side-project, just interacting with websites to look at avaialble golf tee times. Zero intention/plans to do anything commercial, this is just a ...
0
votes
0
answers
53
views
One request fails, but others don't; it also succeeds in terminal
I checked a lot of trouble-shoot topics, but didn't find what might be wrong here... (This is a second attempt at fixing this issue, but this time I dug deeper.)
I'm going off this API documentation: ...
1
vote
1
answer
234
views
Trouble scraping dynamic lottery results table – inconsistent parsing
I’ve been trying to scrape lottery results from a website that shows draws. The data is presented in a results table, but I keep running into strange issues where sometimes the numbers are captured ...