ProductPromotion
Logo

Open.Source

made by https://0x3d.site

GitHub - dukeofharen/httplaceholder: A very flexible cross platform HTTP stub application.
A very flexible cross platform HTTP stub application. - dukeofharen/httplaceholder
Visit Site

GitHub - dukeofharen/httplaceholder: A very flexible cross platform HTTP stub application.

GitHub - dukeofharen/httplaceholder: A very flexible cross platform HTTP stub application.

license

PRs welcome code with hearth by dukeofharen Docker pulls Nuget downloads


About

HttPlaceholder lets you stub away any HTTP webservice.

It was thought up while I was working at a company which had many interconnected webservices. The development process was very painful, because it meant all the other webservices should also be started on my local dev PC, or I had to use the "development" environment, which did not work for half of the time. HttPlaceholder fills this gap nicely.

HttPlaceholder:

  • can easily be installed on your dev PC.
  • can be used to easily create stubs, either as separate YAML files, through the API or through the user interface.
  • can easily be hosted on any server.
  • can use many different HTTP condition checkers and response writers to make your HTTP stubs as specific as you need.

Built With

Getting Started

Prerequisites

Linux, Windows and Mac are supported.

Installation

Follow these steps to install / update HttPlaceholder. If you update HttPlaceholder, make sure to read the changelog to see if there are no breaking changes.

Install on Windows

Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/dukeofharen/httplaceholder/master/scripts/Install-Windows.ps1'))

Install on Linux

curl -o- https://raw.githubusercontent.com/dukeofharen/httplaceholder/master/scripts/install-linux.sh | bash

Install on Mac

curl -o- https://raw.githubusercontent.com/dukeofharen/httplaceholder/master/scripts/install-mac.sh | bash

Docker

HttPlaceholder has a Docker image; it can be found here.

Run the following command to run a basic HttPlaceholder container: docker run -p 5000:5000 dukeofharen/httplaceholder:latest

Install as .NET tool

dotnet tool install --global HttPlaceholder

Example

  • Install HttPlaceholder (see Installation).
  • Create a new .yaml file (e.g. stub.yaml).
  • Copy and paste these contents in your new file:
- id: situation-01
  conditions:
    method: GET
    url:
      path:
        equals: /users
      query:
        id:
          equals: 12
        filter:
          equals: first_name
  response:
    statusCode: 200
    text: |
      {
        "first_name": "John"
      }
    headers:
      Content-Type: application/json
  • Open the terminal in the folder you've added the stub.yaml file and run the following command: httplaceholder. HttPlaceholder will now start and will load the stubs in the current folder.

  • Perform a specific HTTP call to HttPlaceholder so your provided response will be returned.

    • For Linux / Mac (cURL needs to be installed):
    curl "http://localhost:5000/users?id=12&filter=first_name" -D-
    
    • For Windows (uses Powershell):
    (Invoke-WebRequest "http://localhost:5000/users?id=12&filter=first_name").RawContent
    
  • You can view and inspect the performed requests in the user interface at http://localhost:5000/ph-ui.

For more sophisticated examples, go to the samples to view samples for all supported HTTP condition checkers and response writers. Learn more about HttPlaceholder by reading the documentation.

Documentation

Tools

Roadmap

See the open issues for a list of proposed features (and known issues).

Support

Reach out to the maintainer at one of the following places:

Project assistance

If you want to say thank you or/and support active development of HttPlaceholder:

Contributing

First off, thanks for taking the time to contribute! Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make will benefit everybody else and are greatly appreciated.

We have set up a separate document containing our contribution guidelines.

Thank you for being involved!

Authors & contributors

The original setup of this repository is by dukeofharen (https://ducode.org).

For a full list of all authors and contributors, check the contributor's page.

Security

HttPlaceholder follows good practices of security, but 100% security can't be granted in software. HttPlaceholder is provided "as is" without any warranty. Use at your own risk.

For more info, please refer to the security.

License

This project is licensed under the MIT license.

See LICENSE for more information.

Articles
to learn more about the open-source concepts.

Resources
which are currently available to browse on.

mail [email protected] to add your project or resources here 🔥.

FAQ's
to know more about the topic.

mail [email protected] to add your project or resources here 🔥.

Queries
or most google FAQ's about Open-Source.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory