4chan / 4chan-API

Documentation for 4chan's read-only JSON API.
http://www.4chan.org/
1.03k stars 74 forks source link

Rule 3 #61

Closed hyferg closed 6 years ago

hyferg commented 6 years ago

Code looks something like

    headers={'If-Modified-Since': pastResponseTime}
    query = 'https://a.4cdn.org/pol/thread/' + str(id) + '.json'
    response = requests.get(query, headers)

Using either current GMT or header 'last-modified' always returns <200> rather than the <304> desired.

bakugo commented 6 years ago

You're using the requests library wrong. Second parameter is params by default, not headers. Use this instead: requests.get(query, headers=headers)

hyferg commented 6 years ago

thanks