Giter Club home page Giter Club logo

fruits-api-castor's Introduction

Fruits API Documentation Overview The Fruits API provides a simple interface for managing a collection of fruits. It allows users to view a list of fruits, get details about a specific fruit, and add a new fruit to the collection.

Base URL The base URL for accessing the Fruits API is [your base URL]. All the following endpoints should be appended to this base URL.

Endpoints

  1. List All Fruits URL: /fruits Method: GET Description: Retrieves a list of all fruits in the database. Response: A JSON array of fruit objects. Each object contains id, name, and color.
  2. Get a Specific Fruit URL: /fruits/{fruit_id} Method: GET URL Parameters: fruit_id (required) - The unique identifier of the fruit. Description: Fetches details of a specific fruit by its ID. Response: A JSON object containing the id, name, and color of the fruit. Returns null if no fruit is found with the given ID.
  3. Add a New Fruit URL: /add-fruit Method: POST Body Parameters: A JSON object containing: id (Integer, required): The unique identifier for the new fruit. name (String, required): The name of the fruit. color (String, required): The color of the fruit. Description: Adds a new fruit to the database. Response: The newly created fruit object as a JSON. Models Fruit id (Integer): A unique identifier for the fruit. name (String): The name of the fruit. color (String): The color of the fruit. Errors The API uses conventional HTTP response codes to indicate success or failure of an API request. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error due to the provided information (e.g., a required parameter was missing, a fruit with the given ID was not found, etc.), and codes in the 5xx range indicate an error with the server.

fruits-api-castor's People

Contributors

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