Resource-oriented Request
Resource-oriented request
Usage
yarn add resource-oriented-request
example
Basic
@ {} static prefix = 'admin' static header = 'X-Tags': 'test' static { return this } await Post// => GET http://localhost:3000/posts await Post// => GET http://localhost:3000/posts/1 await Post// => GET http://localhost:3000/posts/archives await Post// => POST http://localhost:3000/posts// Form data: {title: 'test title',context: 'long long long context'})
Prefix
static prefix = 'admin' await Post// => GET http://localhost:3000/admin/postsawait Post// => GET http://localhost:3000/admin/posts/1await Post// => POST http://localhost:3000/admin/posts// form data: {title: 'test title',context: 'long long long context'})
Headers
static headers = 'X-Tags': 'test,boom' async { const await Post.get // => GET http://localhost:3000/admin/posts // Requset Header: // ... // X-Tags: test,boom // ...}