Use Redirect in Web Api Controller (HTTP 302 Found)
With Redirect
, you need to send a valid URI
. In your case, if you want to return only the relative URI
, you must tell it to URI class
:
public IHttpActionResult Get()
{
return Redirect(new Uri("/assets/images/avatars/profile.jpg", UriKind.Relative));
}