Code Monkey home page Code Monkey logo

backend_api's Introduction

API DEVELOPMENT

Visit jsonplaceholder website to interact with free api's.

https://jsonplaceholder.typicode.com/

Note that while using POST, PUT, PATCH, DELETE methods the data will not be actually deleted in the server but it will be faked as it was deleted.

API using cURL

Install curl using this command and check it's version

sudo apt install curl -y

curl -V

To send a GET request to this api using curl follow this command:

curl https://jsonplaceholder.typicode.com/todos/1

To send a POST request to this api using curl follow this command:

curl -X POST -H "Content-Type: application/json" -d '{"userId": 11,"id": 202,"title": "Backend", "completed": false}' https://jsonplaceholder.typicode.com/todos
  • -X POST: This option specifies that we're sending a POST request.

  • -H "Content-Type: application/json": This header sets the content type to JSON, indicating the format of the data we're sending in the request body.

  • -d '{"userId": 11,"id": 202,"title": "Backend", "completed": false}' This option specifies the data to be sent in the request body.

To send a PUT request to this api using curl follow this command:

curl -X PUT -H "Content-Type: application/json" -d '{"userId": 1,"id": 2,"title": "API", "completed": false}' https://jsonplaceholder.typicode.com/todos/2

To send a DELETE request to this api using curl follow this command:

curl -X DELETE https://jsonplaceholder.typicode.com/todos/4

POSTMAN

Visit this website to download postman or use the web app:

https://www.postman.com/

RESOURCES

https://learning.postman.com/docs/getting-started/basics/navigating-postman/

https://oxylabs.io/blog/curl-post-requests

https://www.geeksforgeeks.org/rest-api-introduction/

https://www.freecodecamp.org/news/apis-for-beginners/

https://docs.google.com/presentation/d/1OgcHNZGC8S5w9IKcBeNDrI_OvRODjKMQ2_gD5GFYkz4/edit?usp=sharing

backend_api's People

Contributors

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