77
88@app .route ("/html1" ) # $routeSetup="/html1"
99def html1 (): # $routeHandler
10- return "<h1>hello</h1>" # $f-:HttpResponse $f-:contentType =text/html $f-:responseBody="<h1>hello</h1>"
10+ return "<h1>hello</h1>" # $f-:HttpResponse $f-:mimetype =text/html $f-:responseBody="<h1>hello</h1>"
1111
1212
1313@app .route ("/html2" ) # $routeSetup="/html2"
1414def html2 (): # $routeHandler
1515 # note that response saved in a variable intentionally -- we wan the annotations to
1616 # show that we recognize the response creation, and not the return (hopefully). (and
1717 # do the same in the following of the file)
18- resp = make_response ("<h1>hello</h1>" ) # $HttpResponse $contentType =text/html $responseBody="<h1>hello</h1>"
18+ resp = make_response ("<h1>hello</h1>" ) # $HttpResponse $mimetype =text/html $responseBody="<h1>hello</h1>"
1919 return resp
2020
2121
2222@app .route ("/html3" ) # $routeSetup="/html3"
2323def html3 (): # $routeHandler
24- resp = app .make_response ("<h1>hello</h1>" ) # $HttpResponse $contentType =text/html $responseBody="<h1>hello</h1>"
24+ resp = app .make_response ("<h1>hello</h1>" ) # $HttpResponse $mimetype =text/html $responseBody="<h1>hello</h1>"
2525 return resp
2626
2727
@@ -31,30 +31,30 @@ def html3(): # $routeHandler
3131
3232@app .route ("/html4" ) # $routeSetup="/html4"
3333def html4 (): # $routeHandler
34- resp = Response ("<h1>hello</h1>" ) # $HttpResponse $contentType =text/html $responseBody="<h1>hello</h1>"
34+ resp = Response ("<h1>hello</h1>" ) # $HttpResponse $mimetype =text/html $responseBody="<h1>hello</h1>"
3535 return resp
3636
3737
3838@app .route ("/html5" ) # $routeSetup="/html5"
3939def html5 (): # $routeHandler
4040 # note: flask.Flask.response_class is set to `flask.Response` by default.
4141 # it can be overridden, but we don't try to handle that right now.
42- resp = Flask .response_class ("<h1>hello</h1>" ) # $f-:HttpResponse $f-:contentType =text/html $f-:responseBody="<h1>hello</h1>"
42+ resp = Flask .response_class ("<h1>hello</h1>" ) # $f-:HttpResponse $f-:mimetype =text/html $f-:responseBody="<h1>hello</h1>"
4343 return resp
4444
4545
4646@app .route ("/html6" ) # $routeSetup="/html6"
4747def html6 (): # $routeHandler
4848 # note: app.response_class (flask.Flask.response_class) is set to `flask.Response` by default.
4949 # it can be overridden, but we don't try to handle that right now.
50- resp = app .response_class ("<h1>hello</h1>" ) # $f-:HttpResponse $f-:contentType =text/html $f-:responseBody="<h1>hello</h1>"
50+ resp = app .response_class ("<h1>hello</h1>" ) # $f-:HttpResponse $f-:mimetype =text/html $f-:responseBody="<h1>hello</h1>"
5151 return resp
5252
5353
5454@app .route ("/jsonify" ) # $routeSetup="/jsonify"
5555def jsonify_route (): # $routeHandler
5656 data = {"foo" : "bar" }
57- response = jsonify (data ) # $f-:HttpResponse $f-:contentType =application/json $f-:responseBody=data
57+ response = jsonify (data ) # $f-:HttpResponse $f-:mimetype =application/json $f-:responseBody=data
5858 return response
5959
6060
@@ -65,15 +65,15 @@ def jsonify_route(): # $routeHandler
6565
6666@app .route ("/content-type/response-modification1" ) # $routeSetup="/content-type/response-modification1"
6767def response_modification1 (): # $routeHandler
68- resp = make_response ("<h1>hello</h1>" ) # $HttpResponse $contentType =text/html $responseBody="<h1>hello</h1>"
69- resp .content_type = "text/plain" # $f-:HttpResponse $f-:contentType =text/plain
68+ resp = make_response ("<h1>hello</h1>" ) # $HttpResponse $mimetype =text/html $responseBody="<h1>hello</h1>"
69+ resp .content_type = "text/plain" # $f-:HttpResponse $f-:mimetype =text/plain
7070 return resp
7171
7272
7373@app .route ("/content-type/response-modification2" ) # $routeSetup="/content-type/response-modification2"
7474def response_modification2 (): # $routeHandler
75- resp = make_response ("<h1>hello</h1>" ) # $HttpResponse $contentType =text/html $responseBody="<h1>hello</h1>"
76- resp .headers ["content-type" ] = "text/plain" # $f-:HttpResponse $f-:contentType =text/plain
75+ resp = make_response ("<h1>hello</h1>" ) # $HttpResponse $mimetype =text/html $responseBody="<h1>hello</h1>"
76+ resp .headers ["content-type" ] = "text/plain" # $f-:HttpResponse $f-:mimetype =text/plain
7777 return resp
7878
7979
@@ -83,59 +83,59 @@ def response_modification2(): # $routeHandler
8383
8484@app .route ("/content-type/Response1" ) # $routeSetup="/content-type/Response1"
8585def Response1 (): # $routeHandler
86- resp = Response ("<h1>hello</h1>" , mimetype = "text/plain" ) # $HttpResponse $contentType =text/plain $responseBody="<h1>hello</h1>"
86+ resp = Response ("<h1>hello</h1>" , mimetype = "text/plain" ) # $HttpResponse $mimetype =text/plain $responseBody="<h1>hello</h1>"
8787 return resp
8888
8989
9090@app .route ("/content-type/Response2" ) # $routeSetup="/content-type/Response2"
9191def Response2 (): # $routeHandler
92- resp = Response ("<h1>hello</h1>" , content_type = "text/plain; charset=utf-8" ) # $HttpResponse $f-:contentType =text/plain $responseBody="<h1>hello</h1>"
92+ resp = Response ("<h1>hello</h1>" , content_type = "text/plain; charset=utf-8" ) # $HttpResponse $mimetype =text/plain $responseBody="<h1>hello</h1>"
9393 return resp
9494
9595
9696@app .route ("/content-type/Response3" ) # $routeSetup="/content-type/Response3"
9797def Response3 (): # $routeHandler
9898 # content_type argument takes priority (and result is text/plain)
99- resp = Response ("<h1>hello</h1>" , content_type = "text/plain; charset=utf-8" , mimetype = "text/html" ) # $HttpResponse $f-:contentType =text/plain $responseBody="<h1>hello</h1>"
99+ resp = Response ("<h1>hello</h1>" , content_type = "text/plain; charset=utf-8" , mimetype = "text/html" ) # $HttpResponse $mimetype =text/plain $responseBody="<h1>hello</h1>"
100100 return resp
101101
102102
103103@app .route ("/content-type/Response4" ) # $routeSetup="/content-type/Response4"
104104def Response4 (): # $routeHandler
105105 # note: capitalization of Content-Type does not matter
106- resp = Response ("<h1>hello</h1>" , headers = {"Content-TYPE" : "text/plain" }) # $HttpResponse $f+:contentType =text/html $f-:contentType =text/plain $responseBody="<h1>hello</h1>"
106+ resp = Response ("<h1>hello</h1>" , headers = {"Content-TYPE" : "text/plain" }) # $HttpResponse $f+:mimetype =text/html $f-:mimetype =text/plain $responseBody="<h1>hello</h1>"
107107 return resp
108108
109109
110110@app .route ("/content-type/Response5" ) # $routeSetup="/content-type/Response5"
111111def Response5 (): # $routeHandler
112112 # content_type argument takes priority (and result is text/plain)
113113 # note: capitalization of Content-Type does not matter
114- resp = Response ("<h1>hello</h1>" , headers = {"Content-TYPE" : "text/html" }, content_type = "text/plain; charset=utf-8" ) # $HttpResponse $f-:contentType =text/plain $responseBody="<h1>hello</h1>"
114+ resp = Response ("<h1>hello</h1>" , headers = {"Content-TYPE" : "text/html" }, content_type = "text/plain; charset=utf-8" ) # $HttpResponse $mimetype =text/plain $responseBody="<h1>hello</h1>"
115115 return resp
116116
117117
118118@app .route ("/content-type/Response6" ) # $routeSetup="/content-type/Response6"
119119def Response6 (): # $routeHandler
120120 # mimetype argument takes priority over header (and result is text/plain)
121121 # note: capitalization of Content-Type does not matter
122- resp = Response ("<h1>hello</h1>" , headers = {"Content-TYPE" : "text/html" }, mimetype = "text/plain" ) # $HttpResponse $contentType =text/plain $responseBody="<h1>hello</h1>"
122+ resp = Response ("<h1>hello</h1>" , headers = {"Content-TYPE" : "text/html" }, mimetype = "text/plain" ) # $HttpResponse $mimetype =text/plain $responseBody="<h1>hello</h1>"
123123 return resp
124124
125125
126126@app .route ("/content-type/Flask-response-class" ) # $routeSetup="/content-type/Flask-response-class"
127127def Flask_response_class (): # $routeHandler
128128 # note: flask.Flask.response_class is set to `flask.Response` by default.
129129 # it can be overridden, but we don't try to handle that right now.
130- resp = Flask .response_class ("<h1>hello</h1>" , mimetype = "text/plain" ) # $f-:HttpResponse $f-:contentType =text/plain $f-:responseBody="<h1>hello</h1>"
130+ resp = Flask .response_class ("<h1>hello</h1>" , mimetype = "text/plain" ) # $f-:HttpResponse $f-:mimetype =text/plain $f-:responseBody="<h1>hello</h1>"
131131 return resp
132132
133133
134134@app .route ("/content-type/app-response-class" ) # $routeSetup="/content-type/app-response-class"
135135def app_response_class (): # $routeHandler
136136 # note: app.response_class (flask.Flask.response_class) is set to `flask.Response` by default.
137137 # it can be overridden, but we don't try to handle that right now.
138- resp = app .response_class ("<h1>hello</h1>" , mimetype = "text/plain" ) # $f-:HttpResponse $f-:contentType =text/plain $f-:responseBody="<h1>hello</h1>"
138+ resp = app .response_class ("<h1>hello</h1>" , mimetype = "text/plain" ) # $f-:HttpResponse $f-:mimetype =text/plain $f-:responseBody="<h1>hello</h1>"
139139 return resp
140140
141141
0 commit comments