+1 -1 +13
Vote on this proposal

Python Requests

by Sakshi Bansal (speaking)

Section
Web Development
Technical level
Beginner

Objective

We can write Python scripts that are more-or-less similar to that of a web browser. There are various advantages of using Python to interact with the web. Python Requests is a module which provides HTTP capabilities and integration with web seamless when compared with traditional Python modules like urllib2.

Description

Using Python on Web

Python contains libraries which make it help to interact with web-sites to perform tasks like logging into gmail, viewing web pages, filling forms, viewing and saving cookies with nothing more than a few lines of code. Once a request is sent to a server, a Python script would return the information in almost the same way a browser would return.

Urllib/Urllib2

Urllib is the default Python module used for opening HTTP URL’s. It can accomplish other functions like Basic Authentication, getting Cookies, GET and POST requests, Error handling, viewing headers. Urllib2 provides additional functionalities such as fetching URLs using a variety of different protocols like HTTP, FTP. In spite of using both urllib and urllib2 there are various drawbacks.

Python Requests

Requests is a simple, easy-to-use HTTP library written in Python. Urllib3 is embedded within Requests providing additional features like Keep-alive and HTTP connection pooling to be 100% automatic. Requests makes interaction with web services seamless. It overcomes most of the difficulties faced while using urllib/urllib2 like manually adding query strings to your URLs, encoding of data while making GET/POST requests etc. We need to import a single Python module import requests before writing code. The main lead developer of Python-Requests is Kenneth Reitz.

Speaker bio

I am a final year student pursuing B.Tech in Computer Science from Amrita Vishwa Vidyapeetham, India. I am a FOSS enthusiast and have contributed to Open Source projects like Mozilla Thunderbird. I am a part of University hacking team - ‘bi0s’ which participates in various national and international level Capture The Flag(CTF) Ethical Hacking Contests.

Comments


  • 2

    [-] Kushal Das 279 days ago

    Are you an upstream contributor to this project?


  • 1

    [-] Vaidik Kapoor 251 days ago

    This sounds like a tutorial of requests. I think the docs are good enough and this talk does not has much to offer apart from that.

    Do you have plans of speaking about something that the documentation lacks or some usage techniques or something that you have discovered but isn't available in any form of documentation?

Login with Twitter or Google to leave a comment →