Skip to content

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

python-requests

How to POST JSON data with Python Requests?

August 21, 2022 by Magenaut

I need to POST a JSON from a client to a server. I’m using Python 2.7.1 and simplejson. The client is using Requests. The server is CherryPy. I can GET a hard-coded JSON from the server (code not shown), but when I try to POST a JSON to the server, I get “400 Bad Request”.

Categories Python, Q&A Tags cherrypy, json, python, python-requests Leave a comment

Asynchronous Requests with Python requests

August 21, 2022 by Magenaut

I tried the sample provided within the documentation of the requests library for python.

Categories Python, Q&A Tags asynchronous, httprequest, python, python-requests Leave a comment

Proxies with Python ‘Requests’ module

August 21, 2022 by Magenaut

Just a short, simple one about the excellent Requests module for Python.

Categories Python, Q&A Tags http-request, python, python-requests Leave a comment

What are the differences between the urllib, urllib2, urllib3 and requests module?

August 21, 2022 by Magenaut

In Python, what are the differences between the urllib, urllib2, urllib3 and requests modules? Why are there three? They seem to do the same thing…

Categories Python, Q&A Tags python, python-2.x, python-requests, urllib, urllib2 Leave a comment

How can I see the entire HTTP request that’s being sent by my Python application?

August 21, 2022 by Magenaut

In my case, I’m using the requests library to call PayPal’s API over HTTPS. Unfortunately, I’m getting an error from PayPal, and PayPal support cannot figure out what the error is or what’s causing it. They want me to “Please provide the entire request, headers included”.

Categories Python, Q&A Tags debugging, https, python, python-requests Leave a comment

How to use Python requests to fake a browser visit a.k.a and generate User Agent?

August 21, 2022 by Magenaut

I want to get the content from this website.

Categories Python, Q&A Tags python, python-requests, user-agent, web-scraping, wget Leave a comment

Sending “User-agent” using Requests library in Python

August 21, 2022 by Magenaut

I want to send a value for "User-agent" while requesting a webpage using Python Requests. I am not sure is if it is okay to send this as a part of the header, as in the code below:

Categories Python, Q&A Tags python, python-requests, web-crawler Leave a comment

Correct way to try/except using Python requests module?

August 21, 2022 by Magenaut

In the event of a network problem (e.g. DNS failure, refused connection, etc), Requests will raise a ConnectionError exception.

Categories Python, Q&A Tags python, python-requests, request Leave a comment

What’s the best way to parse a JSON response from the requests library?

August 21, 2022 by Magenaut

I’m using the python requests module to send a RESTful GET to a server, for which I get a response in JSON. The JSON response is basically just a list of lists.

Categories Python, Q&A Tags json, python, python-requests, rest Leave a comment

How to upload file with python requests?

August 21, 2022 by Magenaut

I’m performing a simple task of uploading a file using Python requests library. I searched Stack Overflow and no one seemed to have the same problem, namely, that the file is not received by the server:

Categories Python, Q&A Tags file, file-upload, python, python-requests Leave a comment
Older posts
Newer posts
← Previous Page1 Page2 Page3 … Page8 Next →
  1. michealSmith07 on Is there a way to dynamically refresh the less command?August 21, 2022

    That is a very nice post. I like this post.

  2. anonymous on Fix libwacom9 dependency issue when upgrade DebianJune 27, 2022

    saved my day!! Thanks for the help…

  3. sreedhar on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    Thanks its working

  4. saintnick on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    remove libwacom2 worked for me as well

  5. ranafoul on Fix libwacom9 dependency issue when upgrade DebianApril 22, 2022

    apt remove libwacom2 helped on kali 2022.01. gr8

.net ajax asp.net asp.net-core asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-web-api bash c# command-line css custom-post-types custom-taxonomy dataframe dictionary django entity-framework functions gridview html iis javascript jquery json linux list matplotlib numpy pandas php plugin-development plugins posts python python-2.7 python-3.x security shell shell-script sql string vb.net webforms wp-query

© 2026 Magenaut • Built with GeneratePress