path can be string or a hash of options

As per http://restify.com/#client-api it states:

> Note that all further documentation refers to the "short-hand"
> form of methods like get/put/del which take a string path. You
> can also pass in an object to any of those methods with extra
> params (notably headers):

So the path can be either a string or a hash of options.
This commit is contained in:
Erik Mogensen
2016-09-27 13:48:39 +02:00
committed by GitHub
parent 6aff001e47
commit 262f69018b

12
restify/restify.d.ts vendored
View File

@@ -470,12 +470,12 @@ declare module "restify" {
}
interface Client {
get: (path: string, callback?: (err: any, req: Request, res: Response, obj: any) => any) => any;
head: (path: string, callback?: (err: any, req: Request, res: Response) => any) => any;
post: (path: string, object: any, callback?: (err: any, req: Request, res: Response, obj: any) => any) => any;
put: (path: string, object: any, callback?: (err: any, req: Request, res: Response, obj: any) => any) => any;
patch: (path: string, object: any, callback?: (err: any, req: Request, res: Response, obj: any) => any) => any;
del: (path: string, callback?: (err: any, req: Request, res: Response) => any) => any;
get: (opts: any, callback?: (err: any, req: Request, res: Response, obj: any) => any) => any;
head: (opts: any, callback?: (err: any, req: Request, res: Response) => any) => any;
post: (opts: any, object: any, callback?: (err: any, req: Request, res: Response, obj: any) => any) => any;
put: (opts: any, object: any, callback?: (err: any, req: Request, res: Response, obj: any) => any) => any;
patch: (opts: any, object: any, callback?: (err: any, req: Request, res: Response, obj: any) => any) => any;
del: (opts: any, callback?: (err: any, req: Request, res: Response) => any) => any;
basicAuth: (username: string, password: string) => any;
}