Skip to content

what is the best way to access a .json thru HTTPs with header requirement #120866

Discussion options

You must be logged in to vote

Hello @BlazarKnight,

  1. requests with Deflate Issue
    For the requests deflate issue, you can utilize Python's zlib library to handle the compressed data:
import requests
import zlib

headers = {
    'User-Agent': 'Your User Agent',
    'Accept-Encoding': 'deflate'
}

response = requests.get('https://example.com', headers=headers)

if response.headers.get('Content-Encoding') == 'deflate':
    data = zlib.decompress(response.content, -zlib.MAX_WBITS)
else:
    data = response.content
  1. SEC-Edgar Data Types
    When dealing with SEC-Edgar's specific data types, consider using Python libraries like xml.etree.ElementTree or json for parsing structured data. This can help transform the data into a m…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@BlazarKnight
Comment options

Answer selected by BlazarKnight
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Programming Help Programming languages, open source, and software development.
2 participants