An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

          

![demoofqcom](https://unpkg.com/@qcom.io/qcom@1.0.36/qcom.png)
## 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)