Python This requests module is often used to test interfaces. Before using the Requestlibrary Library test, let's look at how this module is used
The simplest call is
R=requests.get ("http://...")
R.text
So what's the usual way to see the results? The whole list is listed below. Can print r.xxx call to see the corresponding results
__attrs__
__bool__
__class__
__delattr__
__dict__
__doc__
__format__
__getattribute__
__getstate__
__hash__
__init__
__iter__
__module__
__new__
__nonzero__
__reduce__
__reduce_ex__
__repr__
__setattr__
__setstate__
__sizeof__
__str__
__subclasshook__
__weakref__
_content
_content_consumed
Apparent_encoding
Close
Connection
Content
Cookies
Elapsed
Encoding
Headers
History
Iter_content
Iter_lines
Json
Links
Ok
Raise_for_status
Raw
Reason
Request
Status_code
Text
Url
Of course requests also has some other methods, rather than construct post,headers, etc. pass parameters to request ...
{' key1 'value1 'key2 ' value2 '}requests. Post("Http://httpbin.org/post"data=payload)R. Text
There's a lot of writing on the Internet, see http://blog.csdn.net/iloveyin/article/details/21444613.
These are recorded for automated testing using Robotframework's Requestlibaray library
Preliminary study on Robotframework interface Test 2