Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to: test local test APIs #80

Open
sc0ttj opened this issue Jul 28, 2019 · 0 comments
Open

How to: test local test APIs #80

sc0ttj opened this issue Jul 28, 2019 · 0 comments

Comments

@sc0ttj
Copy link
Owner

sc0ttj commented Jul 28, 2019

Do this after cgi-bin is working and mdsh can build pages with some kind of bash-cgi stuff: #34

See: https://github.com/micha/resty

Source the script before using it.

  $ . resty

Once resty is installed, set your REST host to which you will be making your requests.

  $ resty http://127.0.0.1:8080/data
  http://127.0.0.1:8080/data*

And now you can Make some HTTP requests.

  $ GET /blogs.json
  [ {"id" : 1, "title" : "first post", "body" : "This is the first post"}, ... ]

  $ PUT /blogs/2.json '{"id" : 2, "title" : "updated post", "body" : "This is the new."}'
  {"id" : 2, "title" : "updated post", "body" : "This is the new."}

  $ DELETE /blogs/2

  $ POST /blogs.json '{"title" : "new post", "body" : "This is the new new."}'
  {"id" : 204, "title" : "new post", "body" : "This is the new new."}
@sc0ttj sc0ttj changed the title How to: Create local test APIs How to: test local test APIs Sep 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant