Closed it-AhmedTaha closed 10 months ago
Hi, @it-AhmedTaha. Yes, here's the example from the README.md:
// Performs a POST on /Orders with the provided object as the JSON body,
// creating a new order and deserializing the created order in a custom model class
var createdOrder = await serviceLayer.Request("Orders").PostAsync<MyOrderModel>(myNewOrderObject);
Hi @bgmulinari, I noticed that it's not possible to do the same for a Patch request, is there a way of knowing that the PatchAsync request was successful?
@trrytch, PATCH requests don't have a return body. Since B1SLayer will throw in case of an error, you can simply use a try/catch to check if your request worked.
Hello, is there a way to get the response of successful post request and return it to the client? For example this request:
await serviceLayer.Request("Invoices").PostAsync(arReserve);
Typically, when performing a successful POST request, a response containing information about the created invoice is returned.