Git Product home page Git Product logo

cache-service's Introduction

Cache Service Rest APIs

Add to cache

Returns boolean response.

  • URL: /v1/cache/add

  • Method: POST

  • Body

    Content: { "key" : "country"", "value" : "capital" }

  • Success Response:

    • Code: 201
      Content: { true }
  • Sample Call:

    curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ \ 
       "key": "country", \ 
       "value": "capital" \ 
     }' 'https://cache-service.herokuapp.com/v1/cache/add'
    

Get from cache

Returns element from cache for a given key.

  • URL: /v1/cache/get/{key}

  • Method: GET

  • URL Params

    Required: key=[string]

  • Success Response:

    • Code: 200
      Content: { "Value" }
  • Error Response:

    • Code: 204 No Content
      Content: { no content }
  • Sample Call:

      curl -X GET --header 'Accept: application/json' 
      'https://cache-service.herokuapp.com/v1/cache/get/country'
    

Peek from cache

Returns most recently added element from cache.

  • URL: /v1/cache/peek

  • Method: GET

  • URL Params

    Required: None

  • Success Response:

    • Code: 200
      Content: { "Value" }
  • Error Response:

    • Code: 204 No Content
      Content: { no content }
  • Sample Call:

     curl -X GET --header 'Accept: application/json' 
      'https://cache-service.herokuapp.com/v1/cache/peek'
    
    

Take from cache

Retrieves and removes the most recently added element from the cache.

  • URL: /v1/cache/take

  • Method: GET

  • URL Params

    Required: None

  • Success Response:

    • Code: 200
      Content: { "Value" }
  • Error Response:

    • Code: 204 No Content
      Content: { no content }
  • Sample Call:

     curl -X GET --header 'Accept: application/json' 
      'https://cache-service.herokuapp.com/v1/cache/take'
    

Remove from cache

Returns true if the element was successfully removed.

  • URL: /v1/cache/remove/{key}

  • Method: DELETE

  • URL Params

    Required: key=[string]

  • Success Response:

    • Code: 200
      Content: { true }
  • Sample Call:

      curl -X DELETE --header 'Accept: application/json' 
       'https://cache-service.herokuapp.com/v1/cache/remove/country'
    

cache-service's People

Contributors

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