# Service Calls

WireBootstrap contains functions to make calls to data services using [jQuery's Ajax](https://api.jquery.com/jquery.ajax) method.

## Get

Use the asynchronous `get` function to get data from a data service using the HTTP GET method.

```javascript
const data = await wire.get("https://data-service");
```

## GetWait

Use the synchronous `getWait` method to get data from a data service using the HTTP GET method.  Note, this is a synchronous call and will hold up the processing thread on that line of code until the response comes back.

```javascript
const data = wire.getWait("https://data-service");
```

## Post

Use the asynchronous `post` function to send data to a data service using the HTTP POST method.  Use the second parameter to send the post payload.

```javascript
const data  = { UserName: "camici", FullName: "Chris Amici" };

await wire.post("https://data-service", data);
```

## PostWait

Use the synchronous `postWait` function to send data to a data service using the HTTP POST method.  Use the second parameter to send the post payload.  Note, this is a synchronous call and will hold up the processing thread on that line of code until the response comes back.

```javascript
const data  = { UserName: "camici", FullName: "Chris Amici" };

wire.postWait("https://data-service", data);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wirebootstrap.com/wirebootstrap/utilities/ajax.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
