Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x = jsonify(message="Hello World!", status_code=90210, status=404)
- print "x = %sn" % str(x))
- print "x.status_code = %sn" % str(x.status_code))
- print "x.status = %sn" % str(x.status))
- print "dir(x) = %sn" % str(dir(x))
- x = <Response 82 bytes [200 OK]>
- x.status_code = 200
- x.status = 200 OK
- dir(x) = ['__call__', '__class__', '__delattr__', '__dict__', '__doc__', '__enter__', '__exit__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_ensure_sequence', '_get_mimetype_params', '_on_close', '_status', '_status_code', 'accept_ranges', 'add_etag', 'age', 'allow', 'autocorrect_location_header', 'automatically_set_content_length', 'cache_control', 'calculate_content_length', 'call_on_close', 'charset', 'close', 'content_encoding', 'content_language', 'content_length', 'content_location', 'content_md5', 'content_range', 'content_type', 'data', 'date', 'default_mimetype', 'default_status', 'delete_cookie', 'direct_passthrough', 'expires', 'force_type', 'freeze', 'from_app', 'get_app_iter', 'get_data', 'get_etag', 'get_wsgi_headers', 'get_wsgi_response', 'headers', 'implicit_sequence_conversion', 'is_sequence', 'is_streamed', 'iter_encoded', 'last_modified', 'location', 'make_conditional', 'make_sequence', 'mimetype', 'mimetype_params', 'response', 'retry_after', 'set_cookie', 'set_data', 'set_etag', 'status', 'status_code', 'stream', 'vary', 'www_authenticate']
- >>> x.get_data()
- '{n "message": "Hello World!", n "status": 404, n "status_code": 90210n}'
- >>> x.headers
- Headers([('Content-Type', u'application/json'), ('Content-Length', u'74')])
- x = jsonify(message="Hello World!", status_code=90210, status=404)
- x.status_code = 404
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement