Testing HTTP GETs is relatively easy. You can simply put the address in your browser and go.
Testing a POST or PUT is a bit more challenging – you may need to supply headers and/or a content body on the request.
Oracle SQL Developer Web does make this possible today, but I haven’t really talked about it in depth.
One last work tweet for the day…I feel like I've not done a good enough job letting folks know @OracleREST now includes OpenAPI doc/client.— Jeff Smith 🍻 (@thatjeffsmith) April 3, 2022
Visualize/TEST your low/nocode @OracleDatabase REST APIs pic.twitter.com/xja6pV7vZE
Using the OpenAPI View
And in that post I was using a REST Client like Insomnia.
But what if I never want to leave the confines of my browser? I’m writing code, now I want to test said code!
From the REST workshop, on the Modules page, simply click the kebab button, and choose ‘OpenAPI View’
Let’s look at the POST
The ‘Try it out’ button is what we want to do.
And we’ll click the Execute button, and voila:
Let’s test the DELETE, too
I didn’t actually have a DELETE, so I’ll just add a DELETE handler to my /tables/emps/:id template, with the following SQL:
delete from emps where id = :id
And coming back to our OpenAPI view –