@digitalpersona/core
Version:
DigitalPersona Web Access Core library
41 lines (24 loc) • 1.2 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[](./index.md) > [@digitalpersona/core](./core.md) > [Url](./core.url.md) > [create](./core.url.create.md)
Constructs an URL string from a base URL, a path and a query object.
<b>Signature:</b>
```typescript
static create(base: string, path?: string | null, query?: object | null): string;
```
| Parameter | Type | Description |
| --- | --- | --- |
| base | <code>string</code> | base URL, e.g. <code>https://contoso.com</code> |
| path | <code>string &
| query | <code>object &
<b>Returns:</b>
`string`
The URL is built by concatenation of a base URL with sanitized path and query object, adding all needed delimiters.
```typescript
const href = Url.create("https://contoso.com", "api/v1/user", { name: "john", type: "5" });
console.log(href);
```
`> https://contoso.com/api/v1/user?name=john&type=5`