Falcon v2.0.0 Documentation
we require 100% coverage at all times. Falcon does not depend on any external Python packages. Flexible. Falcon leaves a lot of decisions and implementation details to you, the API developer. This gives resource. Since we are building an image-sharing API, let’s start by creating an “images” resource. Create a new module, images.py next to app.py, and add the following code to it: import json import falcon falcon class Resource(object): def on_get(self, req, resp): doc = { 'images': [ { 'href': '/images/1eaf6ef1-7f2d-4ecc-a8d5-6e8adba7cc0e.png' } ] } # Create a JSON representation of the resource resp0 码力 | 184 页 | 671.87 KB | 1 年前3Falcon v1.4.1 Documentation
we require 100% coverage at all times. Six and mimeparse are the only third-party dependencies. Flexible. Falcon leaves a lot of decisions and implementation details to you, the API developer. This gives resource. Since we are building an image-sharing API, let’s start by creating an “images” resource. Create a new module, images.py next to app.py, and add the following code to it: import json import falcon falcon class Resource(object): def on_get(self, req, resp): doc = { 'images': [ { 'href': '/images/1eaf6ef1-7f2d-4ecc-a8d5-6e8adba7cc0e.png' } ] } # Create a JSON representation of the resource (continues0 码力 | 158 页 | 587.88 KB | 1 年前3Falcon v1.4.0 Documentation
we require 100% coverage at all times. Six and mimeparse are the only third-party dependencies. Flexible. Falcon leaves a lot of decisions and implementation details to you, the API developer. This gives resource. Since we are building an image-sharing API, let’s start by creating an “images” resource. Create a new module, images.py next to app.py, and add the following code to it: import json import falcon falcon class Resource(object): def on_get(self, req, resp): doc = { 'images': [ { 'href': '/images/1eaf6ef1-7f2d-4ecc-a8d5-6e8adba7cc0e.png' } ] } # Create a JSON representation of the resource0 码力 | 156 页 | 573.94 KB | 1 年前3Falcon v1.4.1 Documentation
we require 100% coverage at all times. Six and mimeparse are the only third-party dependencies. Flexible. Falcon leaves a lot of decisions and implementation details to you, the API developer. This gives resource. Since we are building an image-sharing API, let’s start by creating an “images” resource. Create a new module, images.py next to app.py, and add the following code to it: import json import falcon falcon class Resource(object): def on_get(self, req, resp): doc = { 'images': [ { 'href': '/images/1eaf6ef1-7f2d-4ecc-a8d5-6e8adba7cc0e.png' } ] } # Create a JSON representation of the resource0 码力 | 156 页 | 574.46 KB | 1 年前3Falcon v2.0.0 Documentation
your application Request and Response Objects Refactoring for testability Functional tests Serving Images Introducing Hooks Error Handling What Now? FAQ Design Philosophy Performance Routing Extensibility we require 100% coverage at all times. Falcon does not depend on any external Python packages. Flexible. Falcon leaves a lot of decisions and implementation details to you, the API developer. This gives resource. Since we are building an image-sharing API, let’s start by creating an “images” resource. Create a new module, images.py next to app.py, and add the following code to it: import json import falcon0 码力 | 265 页 | 299.57 KB | 1 年前3Falcon v3.1.1-b3 Documentation
this makes it easier to reason about the code and to debug edge cases in large-scale deployments. Flexible. Falcon leaves a lot of decisions and implementation details to you, the API developer. This gives creating an “images” resource. Create a new module, images.py next to app.py, and add the following code to it: import json import falcon class Resource: def on_get(self, req, resp): doc = { 'images': [ { { 'href': '/images/1eaf6ef1-7f2d-4ecc-a8d5-6e8adba7cc0e.png' } ] } # Create a JSON representation of the resource resp.text = json.dumps(doc, ensure_ascii=False) # The following line can be omitted0 码力 | 378 页 | 1.29 MB | 1 年前3Falcon v3.1.1-b1 Documentation
this makes it easier to reason about the code and to debug edge cases in large-scale deployments. Flexible. Falcon leaves a lot of decisions and implementation details to you, the API developer. This gives creating an “images” resource. Create a new module, images.py next to app.py, and add the following code to it: import json import falcon class Resource: def on_get(self, req, resp): doc = { 'images': [ { { 'href': '/images/1eaf6ef1-7f2d-4ecc-a8d5-6e8adba7cc0e.png' } ] } # Create a JSON representation of the resource resp.text = json.dumps(doc, ensure_ascii=False) # The following line can be omitted0 码力 | 378 页 | 1.29 MB | 1 年前3Falcon v3.1.1-a Documentation
this makes it easier to reason about the code and to debug edge cases in large-scale deployments. Flexible. Falcon leaves a lot of decisions and implementation details to you, the API developer. This gives creating an “images” resource. Create a new module, images.py next to app.py, and add the following code to it: import json import falcon class Resource: def on_get(self, req, resp): doc = { 'images': [ { { 'href': '/images/1eaf6ef1-7f2d-4ecc-a8d5-6e8adba7cc0e.png' } ] } # Create a JSON representation of the resource resp.text = json.dumps(doc, ensure_ascii=False) # The following line can be omitted0 码力 | 378 页 | 1.29 MB | 1 年前3Falcon v3.1.0 Documentation
this makes it easier to reason about the code and to debug edge cases in large-scale deployments. Flexible. Falcon leaves a lot of decisions and implementation details to you, the API developer. This gives creating an “images” resource. Create a new module, images.py next to app.py, and add the following code to it: import json import falcon class Resource: def on_get(self, req, resp): doc = { 'images': [ { { 'href': '/images/1eaf6ef1-7f2d-4ecc-a8d5-6e8adba7cc0e.png' } ] } # Create a JSON representation of the resource resp.text = json.dumps(doc, ensure_ascii=False) # The following line can be omitted0 码力 | 362 页 | 1.29 MB | 1 年前3Falcon v3.1.1 Documentation
this makes it easier to reason about the code and to debug edge cases in large-scale deployments. Flexible. Falcon leaves a lot of decisions and implementation details to you, the API developer. This gives creating an “images” resource. Create a new module, images.py next to app.py, and add the following code to it: import json import falcon class Resource: def on_get(self, req, resp): doc = { 'images': [ { { 'href': '/images/1eaf6ef1-7f2d-4ecc-a8d5-6e8adba7cc0e.png' } ] } # Create a JSON representation of the resource resp.text = json.dumps(doc, ensure_ascii=False) # The following line can be omitted0 码力 | 378 页 | 1.29 MB | 1 年前3
共 40 条
- 1
- 2
- 3
- 4