I have an WebApi endpoint for a database table in which 3 columns are PKs. In some cases one of the keys is an empty string ('') in the database.
Is it possible to supply this empty string value in my request URL?
Example:
[RoutePrefix("api/Endpoint")]
public partial class APIUserCustomerController : BaseApiController<APIUserCustomer>
{
[HttpDelete, Route("{UserName}/{CustomerNum}/{ShippingAddress}")]
public HttpResponseMessage Delete(System.String UserName, System.String CustomerNum, System.String ShippingAddress)
{
...
}
}
I've tried:
DELETE api/Endpoint/username/customerNum/, which gives me HTTP Error 404.0 - Not Found
as well as:
DELETE api/Endpoint/username/customerNum/%20 which gives me Server Error in '/' Application. The resource cannot be found.
Is there a solution that I'm missing, or am I just SOL in regards to empty strings in my db?
DELETE api/Endpoint/username/customerNum//do? orDELETE api/Endpoint/username/customerNum/%20/