Skip to content

Tag: urllib

Python – Converting urllib to requests

I’m writing code to access the MS365 API and the Python code example uses urllib. I want to instead use requests but I’m not sure how urllib translates into requests as my attempts of doing so have failed. The code example can be found here: https://learn.microsoft.com/en-us/microsoft-365/security…

403 Forbidden error when getting cat images

I just finished programming a dog photo program, and after a few issues it works fine. I decided to make a modified version that uses a different api to give cat images instead. It took a second to figure out but after changing the format, I get this error: urllib.error.HTTPError: HTTP Error 403: Forbidden Th…

Python: urllib.parse.quote_plus and edit string

I need to add a wild card to a urllib.parse.quote_plus command but I am unclear how to. When I execute the following on my flask server, I get the following error: How might I add a wildcard in here to accept an object? Answer i think you should do the replacing first or