Giter Site home page Giter Site logo

riposte's Introduction

Riposte

A server that allows clients to specify the response code that the server will return.

This could be useful for testing the logic of a client for rare or difficult to set up client-server interactions.

Instalation

Dowload binary

Currently only a linux binary is avalable.

  1. Download the latest version from the releases page.
  2. Give executable permision to the binary chmod u+x path/to/riposte

Or build from source

  1. Instal cargo (the rust package manager)
  2. cargo install riposte

The binary will be on .cargo/bin/riposte.

Usage

Start the server (the port number can be specified, default is 8080)

riposte -p 8000

Make a request to the server which includes the header riposte-request: <code status>

Only http1.1 is currently supported

The request method can be anything and the path can also be anything

The code status must be in the range 100-999

The server will respond with that status code and the response will have the header riposte-response: <the status code specified>

Examples

Example 1

Request:

GET / HTTP/1.1
Host: 127.0.0.1:8080
riposte-request: 418

Response:

HTTP/1.1 418 I'm a teapot
riposte-response: 418
content-length: 0

Example 2

Request:

POST /baz HTTP/1.1
Host: foo.bar
Content-Type: application/x-www-form-urlencoded
Content-Length: 27
riposte-request: 502

field1=val1&field2=val2

Response:

HTTP/1.1 502 Bad Gateway
riposte-response: 502
content-lenght: 0

riposte's People

Contributors

tomascarreira avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.