Tuesday, March 06, 2012

Test RESTful endpoints for OAuth with curl

It's weird I never really got into RESTful testing while at BEA or Oracle but now I have an opportunity to do some REST with OAuth at my current job.

Basically POST, GET, PUT, DELETE matches CRUD operations.

I can also easily exercise REST endpoints with curl on the command line too.

For example I can use an example curl command line below to retrieve a user record using the GET endpoint:

curl --basic -u [username to authenticate with]:[password] -H "Content-Type: application/json" -X GET https://localhost:9031/pf-ws/rest/oauth/clients/[username to retrieve] --insecure

For POST and PUT endpoints I need to reference a file to add a record or update a record.

No comments:

Exploring ELK (Elastic) Stack for hack-a-thon

At my current gig, our group finally got to do hack-a-thon week and I joined a team project that tied together a few of the technologies I&#...