1.0.8 • Published 2 years ago

thedesk v1.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

The Desk

Build Status

GET

GET is a modified version of a native HTTP request method. Example usage is down below;

import { Caller, CallerConf, IRData } from "thedesk"

const args: CallerConf = {
	BaseURL: "https://datausa.io",
}

const caller = new Caller(args)

const urlParams = {
	drilldowns: "Nation",
	measures: "Population",
}

caller.GET("/api/data", { params: urlParams })
	.then((response: IRData) => {
		console.log(response.load)
	})
	.catch((e: any) => {
		console.log(e)
	})

CallerConf ( Caller Configration Interface)

{
	Mode?: string
	Cache?: TCache
	Credentials?: TCredentials
	Redirect?: TRedirect
	ReferrerPolicy?: TReferrerPolicy
        
	BaseURL: string,
	Timeout?: number,
	WithCredentials?: boolean,
	Headers?: any,
	ResponseType?: "json",
    ResponseEncoding?: "utf8",
    XsrfCookieName?: "XSRF-TOKEN",
    XsrfHeaderName?: "X-XSRF-TOKEN"
}

IRData ( Response Data Interface)

{
    load: any,
    status: string,
    status_code: number,
    last_pulled: number,
    error: boolean
}

License

MIT Kadir KOCA - kadirrkoca@gmail.com for feedback

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago