[b]"Having issues with python pip urllib.request - anyone know how to fix common errors?"[/b] or [b]"Best practice

20 Replies, 800 Views

urllib.request vs. Request? Use `Request` when you need headers or POST data. `urlopen` is for simple GETs.

For SSL, this might help:

```python
import certifi
import ssl
context = ssl.create_default_context(cafile=certifi.where())
response = urllib.request.urlopen('https://example.com', context=context)
```

Still, `requests` is king.

Messages In This Thread



Users browsing this thread: 1 Guest(s)