Skip to main content

No project description provided

Project description

MimeProvider

Small framework component for pyramid to serialize/deserializer resources depending on mimetypes.

This project is suitable for data driven REST api’s, it adapts to the standard negotation in HTTPs, or specifically the Accept and Content-Type headers to decide the format and type of incoming and outgoing resources.

Example

see examples/small_application.py

If you boot up the example application, you will see the magic in action.

curl http://localhost:8080/missing -H “Accept: /” -v

or surf to the same address, notice that it serves a minimal html page describing the resource.

curl http://localhost:8080/missing -H “Accept: /” -H “Content-Type: application/somedata+json” –data ‘{“string”: “Oh No”, “integer”: 42, “somelist”: [1, 2, 3, 4]}’

The sole responsibility for this project is to assert that types are negotiated correctly, and are clearly distinguished from formats. In order to build a fully functional API there are still a few steps necessary.

  • Schema validation

  • Database access (if applicable)

  • Data binding (from front-end data types to backend)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

mimey3000-0.1.5.zip (11.7 kB view hashes)

Uploaded Source

mimey3000-0.1.5.tar.gz (7.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page