Preliminary study on Robotframework interface Test 2

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.