Guzzle PHP 5.3 Documentationand files, and abstracts away the underlying HTTP transport layer. Can send both synchronous and asynchronous requests using the same interface without requiring a dependency on a specific event loop. Pluggable $res->getBody(); // {"type":"User"...' var_export($res->json()); // Outputs the JSON decoded data // Send an asynchronous request. $req = $client->createRequest('GET', 'http://httpbin.org', ['future' => true]); $cl Adapter Test Web Server FAQ Why should I use Guzzle? Does Guzzle require cURL? Can Guzzle send asynchronous requests? How can I add custom cURL options? How can I add custom stream context options? Why0 码力 | 72 页 | 312.62 KB | 11 月前3
Falcon v3.1.1-b3 Documentationreturn thing class StorageError(Exception): @staticmethod def handle(ex, req, resp, params): # TODO: Log the error, clean up, etc. before raising raise falcon.HTTPInternalServerError() class SinkAdapter: thing class StorageError(Exception): @staticmethod async def handle(ex, req, resp, params): # TODO: Log the error, clean up, etc. before raising raise falcon.HTTPInternalServerError() class SinkAdapter: stream, resp.content_length = self._image_store.open(name) except IOError: # Normally you would also log the error. raise falcon.HTTPNotFound() Now let’s try that request again: $ http localhost:8000/images/voltron0 码力 | 378 页 | 1.29 MB | 1 年前3
Falcon v3.1.1-b1 Documentationreturn thing class StorageError(Exception): @staticmethod def handle(ex, req, resp, params): # TODO: Log the error, clean up, etc. before raising raise falcon.HTTPInternalServerError() class SinkAdapter: thing class StorageError(Exception): @staticmethod async def handle(ex, req, resp, params): # TODO: Log the error, clean up, etc. before raising raise falcon.HTTPInternalServerError() class SinkAdapter: stream, resp.content_length = self._image_store.open(name) except IOError: # Normally you would also log the error. raise falcon.HTTPNotFound() Now let’s try that request again: $ http localhost:8000/images/voltron0 码力 | 378 页 | 1.29 MB | 1 年前3
Falcon v3.1.1-a Documentationreturn thing class StorageError(Exception): @staticmethod def handle(ex, req, resp, params): # TODO: Log the error, clean up, etc. before raising raise falcon.HTTPInternalServerError() class SinkAdapter: thing class StorageError(Exception): @staticmethod async def handle(ex, req, resp, params): # TODO: Log the error, clean up, etc. before raising raise falcon.HTTPInternalServerError() class SinkAdapter: stream, resp.content_length = self._image_store.open(name) except IOError: # Normally you would also log the error. raise falcon.HTTPNotFound() Now let’s try that request again: $ http localhost:8000/images/voltron0 码力 | 378 页 | 1.29 MB | 1 年前3
Falcon v3.1.0 Documentationreturn thing class StorageError(Exception): @staticmethod def handle(ex, req, resp, params): # TODO: Log the error, clean up, etc. before raising raise falcon.HTTPInternalServerError() class SinkAdapter: thing class StorageError(Exception): @staticmethod async def handle(ex, req, resp, params): # TODO: Log the error, clean up, etc. before raising raise falcon.HTTPInternalServerError() class SinkAdapter: stream, resp.content_length = self._image_store.open(name) except IOError: # Normally you would also log the error. raise falcon.HTTPNotFound() Now let’s try that request again: $ http localhost:8000/images/voltron0 码力 | 362 页 | 1.29 MB | 1 年前3
Falcon v3.1.1 Documentationreturn thing class StorageError(Exception): @staticmethod def handle(ex, req, resp, params): # TODO: Log the error, clean up, etc. before raising raise falcon.HTTPInternalServerError() class SinkAdapter: thing class StorageError(Exception): @staticmethod async def handle(ex, req, resp, params): # TODO: Log the error, clean up, etc. before raising raise falcon.HTTPInternalServerError() class SinkAdapter: stream, resp.content_length = self._image_store.open(name) except IOError: # Normally you would also log the error. raise falcon.HTTPNotFound() Now let’s try that request again: $ http localhost:8000/images/voltron0 码力 | 378 页 | 1.29 MB | 1 年前3
Falcon v3.1.1-rc1 Documentationreturn thing class StorageError(Exception): @staticmethod def handle(ex, req, resp, params): # TODO: Log the error, clean up, etc. before raising raise falcon.HTTPInternalServerError() class SinkAdapter: thing class StorageError(Exception): @staticmethod async def handle(ex, req, resp, params): # TODO: Log the error, clean up, etc. before raising raise falcon.HTTPInternalServerError() class SinkAdapter: stream, resp.content_length = self._image_store.open(name) except IOError: # Normally you would also log the error. raise falcon.HTTPNotFound() Now let’s try that request again: $ http localhost:8000/images/voltron0 码力 | 378 页 | 1.29 MB | 1 年前3
Falcon v3.0.0-b2 Documentationreturn thing class StorageError(Exception): @staticmethod def handle(ex, req, resp, params): # TODO: Log the error, clean up, etc. before raising raise falcon.HTTPInternalServerError() class SinkAdapter: thing class StorageError(Exception): @staticmethod async def handle(ex, req, resp, params): # TODO: Log the error, clean up, etc. before raising raise falcon.HTTPInternalServerError() class SinkAdapter: stream, resp.content_length = self._image_store.open(name) except IOError: # Normally you would also log the error. raise falcon.HTTPNotFound() Now let’s try that request again: $ http localhost:8000/images/voltron0 码力 | 340 页 | 1.15 MB | 1 年前3
Falcon v3.0.0 Documentationreturn thing class StorageError(Exception): @staticmethod def handle(ex, req, resp, params): # TODO: Log the error, clean up, etc. before raising raise falcon.HTTPInternalServerError() class SinkAdapter: thing class StorageError(Exception): @staticmethod async def handle(ex, req, resp, params): # TODO: Log the error, clean up, etc. before raising raise falcon.HTTPInternalServerError() class SinkAdapter: stream, resp.content_length = self._image_store.open(name) except IOError: # Normally you would also log the error. raise falcon.HTTPNotFound() Now let’s try that request again: $ http localhost:8000/images/voltron0 码力 | 344 页 | 1.16 MB | 1 年前3
Falcon v3.0.1 Documentationreturn thing class StorageError(Exception): @staticmethod def handle(ex, req, resp, params): # TODO: Log the error, clean up, etc. before raising raise falcon.HTTPInternalServerError() class SinkAdapter: thing class StorageError(Exception): @staticmethod async def handle(ex, req, resp, params): # TODO: Log the error, clean up, etc. before raising raise falcon.HTTPInternalServerError() class SinkAdapter: stream, resp.content_length = self._image_store.open(name) except IOError: # Normally you would also log the error. raise falcon.HTTPNotFound() Now let’s try that request again: $ http localhost:8000/images/voltron0 码力 | 344 页 | 1.16 MB | 1 年前3
共 74 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8













