mirror of
https://github.com/blender/blender-addons-contrib.git
synced 2025-08-20 14:13:00 +00:00
Extensions: Specify JSON in the URL headers
This way the URL can simply be: `https://extesions.blender.org` Later we will also add the Blender version in the header. Internally the server will then use this information to point Blender to the right API entry. Related: https://projects.blender.org/infrastructure/extensions-website/pulls/20 Pull Request: https://projects.blender.org/blender/blender-addons-contrib/pulls/24
This commit is contained in:
@ -489,11 +489,13 @@ def url_retrieve_to_data_iter(
|
||||
from urllib.error import ContentTooShortError
|
||||
from urllib.request import urlopen
|
||||
|
||||
with contextlib.closing(urlopen(
|
||||
url,
|
||||
data,
|
||||
timeout=timeout_in_seconds,
|
||||
)) as fp:
|
||||
headers = {'Accept': 'application/json'}
|
||||
request = urllib.request.Request(
|
||||
url,
|
||||
data=data,
|
||||
headers=headers)
|
||||
|
||||
with contextlib.closing(urlopen(request, timeout=timeout_in_seconds)) as fp:
|
||||
headers = fp.info()
|
||||
|
||||
size = -1
|
||||
|
Reference in New Issue
Block a user