On successfully creating a Listing, AuctionWorx Web API returns a Location response header set to the Web API location of the newly created Listing.
Here's an example Location header URI from the AuctionWorx demo site:
https://www.rainworx.com/awedemo/api/listing/352369
A client app can use the preceding information to fetch and manipulate the listing and its contents.
Note: See the API ListingController class (\Project\Areas\API\Controllers\ListingController.cs) for built-in services to Create/Update/Get/Delete Listings
For demonstration purposes, the Android client reads the returned Location header's AbsoluteUri property, replaces the resource path with the path to the listing's Web page, and renders a hyperlink. The app user can tap the link ( ) to view the new listing in the default browser.
lblListingURL.Text = listinglocation.AbsoluteUri.Replace("api", "Listing/Details");
Tip: The server's response includes a ReasonPhrase string that reports the transaction status (e.g., Created).
lblResponse.Text = "Server Response: " + response.ReasonPhrase;
Copyright © 2002-2022. RainWorx Software. All rights reserved.