Git Product home page Git Product logo

httplayground's Introduction

Table of Contents generated with DocToc

httpplayground

httpbin(1): HTTP Request & Response Service

See http://httpbin.org/

Testing an HTTP Library can become difficult sometimes. RequestBin is fantastic for testing POST requests, but doesn't let you control the response. This exists to cover all kinds of HTTP scenarios. Additional endpoints are being considered.

The requests can be made directly against the http://httpbin.org/ endpoint

Or the python/flask server can be run locally: $ start_localserver.sh

Ok-Retrofit

In ok-retrofit/src/test/kotlin/ApiTests.kt we have calls to httpbin

Postman & newman

A postman collection is provided that call the most important httpbin endpionts

The requests contains Pre-request Script and Tests written in javascript allowing to validate the response

The requests can be run either individually in Postman

Or via the Postman Runner

Or via the newman command-line:

$ test_newman.sh

→ /image
  GET http://httpbin.org/image [200 OK, 10.53KB, 304ms]
  ✓  Content-Type is image/webp

→ /xml
  GET http://httpbin.org/xml [200 OK, 741B, 126ms]
  ✓  Status code is 200
  ✓  Valid xml
  ✓  /slideshow/[title]
  ✓  /slideshow/slide[0]/title

→ /ip
  GET http://httpbin.org/ip [200 OK, 251B, 125ms]
  ✓  Status code is 200
  ✓  Valid Json Schema

→ /user-agent
  GET http://httpbin.org/user-agent [200 OK, 262B, 125ms]
  ✓  Status code is 200
  ✓  Valid Json Schema

→ /get
  GET http://httpbin.org/get [200 OK, 456B, 123ms]
  ✓  Status code is 200
  ✓  Valid Json Schema
  ✓  Has no args

→ /get?params
  GET http://httpbin.org/get?id=1&gender=MALE [200 OK, 513B, 136ms]
  ✓  Status code is 200
  ✓  Valid Json Schema
  ✓  Has expected args

→ /status/{status}
  GET http://httpbin.org/status/304 [304 Not Modified, 177B, 123ms]
  ✓  Status code - Not modified

→ /cache with etag
  GET http://httpbin.org/cache [304 Not Modified, 177B, 145ms]
  ✓  Status code - Not modified

(...)

Junit and html reports are available under the directory postman/newman

httplayground's People

Stargazers

 avatar

Watchers

 avatar  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.