https://github.com/itsmaheshkariya/api
Promise based HTTP client for the Deno.
https://github.com/itsmaheshkariya/api
api client http javascript library typescript
Last synced: 6 months ago
JSON representation
Promise based HTTP client for the Deno.
- Host: GitHub
- URL: https://github.com/itsmaheshkariya/api
- Owner: itsmaheshkariya
- License: mit
- Created: 2020-05-23T12:34:33.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-05-23T13:22:24.000Z (over 5 years ago)
- Last Synced: 2025-04-22T12:37:03.622Z (10 months ago)
- Topics: api, client, http, javascript, library, typescript
- Language: JavaScript
- Size: 4.88 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

## API
### Promise based HTTP client for the browser and Deno.
#### Getting Started
```ts
import api from 'https://deno.land/x/api/index.ts' // For Ts
// import api from 'https://deno.land/x/api/index.js' // For JS
console.log(await api.get('https://jsonplaceholder.typicode.com/todos/'))
console.log(await api.getone('https://jsonplaceholder.typicode.com/todos/',1))
console.log(await api.post('https://jsonplaceholder.typicode.com/todos/',{
userId: 5,
title: "excepturi a et neque qui expedita vel voluptate",
completed: false
}))
console.log(await api.delete('https://jsonplaceholder.typicode.com/todos/1'))
console.log(await api.put('https://jsonplaceholder.typicode.com/todos/1',{
userId: 1,
title: "one",
completed: true
}))
```
### Run
```
deno run -A file_name.ts
```
## Configuration
Use api.get : For Get Method.
console.log(await api.get('https://jsonplaceholder.typicode.com/todos/'))
Use api.getone : For GetOne Method.
console.log(await api.getone('https://jsonplaceholder.typicode.com/todos/',1))
Use api.post : For Post Method.
console.log(await api.post('https://jsonplaceholder.typicode.com/todos/',{
userId: 5,
title: "excepturi a et neque qui expedita vel voluptate",
completed: false
}))
Use api.delete : For Delete Method.
console.log(await api.delete('https://jsonplaceholder.typicode.com/todos/1'))
Use api.put : For Put Method.
console.log(await api.put('https://jsonplaceholder.typicode.com/todos/1',{
userId: 1,
title: "one",
completed: true
}))
## License
[MIT](LICENSE)