Code Monkey home page Code Monkey logo

mini-postman's Introduction

Mini Postman

A simple application that offers a sleek user interface to make HTML requests (GET/ POST), without the hassle of writing a bunch of code just to test an API's functionality.

๐Ÿš€ Description

1. Enter url of the API you want to test.

2. Add JSON content / key-value pairs when using POST Request.

3. Send the request and API response will be available in the box provided. Copy the response for future use.

4. Take a demo of application here

5. For testing local API's, we need to enable the CORS policy.

Enabling the testing of your localhost API's like: localhost:3000/api/users)

# Allow the CORS (Cross Origin Resource Sharing) in your API. 

# For example while using Node.js, Access-Control-Allow-Origin lets you easily perform cross-domain Ajax requests in web applications. 

# Simply activate the add-on and perform the request. CORS or Cross Origin Resource Sharing is blocked in modern browsers by default (in JavaScript APIs).

Example: Using Node.js to create a REST API

Just include the code snippet to your server.js file and test the API using Mini-postman

app.use(function(req, res, next) {
  res.header("Access-Control-Allow-Origin", "*");
  res.header("Access-Control-Allow-Methods", "GET,HEAD,OPTIONS,POST,PUT");
  res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Authorization");
  next();
});

Read more about CORS here

mini-postman's People

Contributors

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