Service Calls
WireBootstrap contains functions to make calls to data services using jQuery's Ajax method.
Get
Use the asynchronous get
function to get data from a data service using the HTTP GET method.
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.
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.
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.
const data = { UserName: "camici", FullName: "Chris Amici" };
wire.postWait("https://data-service", data);
Last updated
Was this helpful?