Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Cross-library feature rich HTTP request / response API

License

NotificationsYou must be signed in to change notification settings

digital-fabric/qeweney

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gem VersionModulation TestMIT licensed

Cross-library HTTP request / response API for servers

Qeweney provides a uniform API for dealing with HTTP requests and responses onthe server side. Qeweney defines a uniform adapter interface that allowshandling incoming HTTP requests and sending HTTP responses over any protocol ortransport, be it HTTP/1, HTTP/2 or a Rack interface.

Qeweney is primarily designed to work withTipi, but can also be used directlyinside Rack apps, or to drive Rack apps.

Features

  • Works with different web server APIs, notably Tipi, Digital Fabric, and Rack.
  • Transport-agnostic.
  • High-performance routing API inspired by Roda.
  • Rich API for extracting data from HTTP requests: form parsing, cookies, fileuploads, etc.
  • Rich API for constructing HTTP responses: streaming responses, HTTP upgrades,static file serving, delate and gzip encoding, caching etc.
  • Suitable for both blocking and non-blocking concurrency models.
  • Allows working with request before request body is read and parsed.

Overview

In Qeweney, the main class developers will interact with isQeweney::Request,which encapsulates an HTTP request (from the server's point of view), and offersan API for extracting request information and responding to that request.

A request is always associated with anadapter, an object that implements theQeweney adapter interface, and that allows reading request bodies (for uploadsand form submissions) and sending responses.

The Qeweney Adapter Interface

classAdapterInterface# Reads a chunk from the request body# @req [Qeweney::Request] request for which the chunk is to be readdefget_body_chunk(req)end# Send a non-streaming response# @req [Qeweney::Request] request for which the response is sent# @body [String, nil] response body# @headers [Hash] response headersdefrespond(req,body,headers)end# Send only headers# @req [Qeweney::Request] request for which the response is sent# @headers [Hash] response headers# @empty_response [boolean] whether response is emptydefsend_headers(req,headers,empty_response:nil)end# Send a body chunk (this implies chunked transfer encoding)# @req [Qeweney::Request] request for which the response is sent# @body [String, nil] chunk# @done [boolean] whether response is finisheddefsend_chunk(req,body,done:false)end# Finishes response# @req [Qeweney::Request] request for which the response is sentdeffinish(req)endend

About

Cross-library feature rich HTTP request / response API

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Languages


[8]ページ先頭

©2009-2025 Movatter.jp