Hi!
I was going through MVC
Architecture<http://docs.sencha.com/ext-js/4-0/#/guide/application_architecture>example
of Ext JS framework using local Apache server. After finishing it I
tried to go further by replacing static json files from example with live
json data served by Flask app with this code:
@app.route('/data/users.json')
def users():
return jsonify(success=True,
users=[
{'id':1, 'name':'Ed', 'email':'[email protected]'},
{'id':2, 'name':'Tommy', 'email':'[email protected]'}
]);
Example didn't work with it, however. I think the reason is lack of HTTP
access control support in Werkzeug's web server.
Are there any plans to support HTTP access
control<https://developer.mozilla.org/en/HTTP_access_control>in Werkzeug's web
server?
Below is request/response from the example I was working with.
Request:
OPTIONS /data/users.json?_dc=1313965460069&page=1&start=0&limit=25 HTTP/1.1
Host: localhost.local:5000
User-Agent: Mozilla/5.0 (Windows NT 6.0; WOW64; rv:7.0) Gecko/20100101
Firefox/7.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
Origin: http://localhost.local
Access-Control-Request-Method: GET
Access-Control-Request-Headers: x-requested-with
Response:
HTTP/1.0 200 OK
Content-Type: text/html; charset=utf-8
Allow: HEAD, OPTIONS, GET
Content-Length: 0
Server: Werkzeug/0.7.1 Python/2.7.2
Date: Sun, 21 Aug 2011 22:24:20 GMT
--
You received this message because you are subscribed to the Google Groups
"pocoo-libs" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/pocoo-libs/-/ZGzRqWMocb8J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pocoo-libs?hl=en.