Comment on page
Service Calls
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");
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");
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);
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 modified 3yr ago