Skip to content

usf-it-rc/cwa_rest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

cwa_rest

A very simple REST client used by the CWA (Cluster Web Access) interface

Another REST client?

Yep. All I needed was the ability to GET, POST, DELETE JSON objects and I wanted to dry up my code. Hence:

CwaRest.client({
  :verb => :POST,
  :url  => "https://host.example.com/blah",
  :user => "my_user",
  :password => "my_password",
  :json => {
    'param1' => 'value',
    'param2' => 'value', 
    'param3' => {
      'subparam1' => 'value'
    }
  }
})

Yes. I was tired of converting Hash => JSON and vice-versa. This little helper methods helped to clean up my code a bit. Nothing fancy. Returns a Hash from a JSON object.
Raises exceptions on various HTTP error codes or if it cannot convert the return body to JSON => Hash

There are a couple of other helper methods for encrypting and decrypting AES since this code is primary used for a password-syncing back-end tool. I doubt anyone else will find this code useful except, perhaps, as an example.

About

Simple REST client for CWA

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages