Class HTTPRedirect
HTTPRedirect can be used to send a 301 redirect response to the caller, where the Authority/Host and the URI in the response can be swapped with the specified values. For example, the following rule redirects requests for /v1/getProductRatings API on the ratings service to /v1/bookRatings provided by the bookratings service.
Namespace: Neon.Kube.Resources.Istio
Assembly: Neon.Kube.Resources.dll
Syntax
public class HTTPRedirect
Constructors
HTTPRedirect()
Initializes a new instance of the HTTPRedirect class.
Declaration
public HTTPRedirect()
Properties
Authority
On a redirect, overwrite the Authority/Host portion of the URL with this value.
Declaration
[JsonProperty(PropertyName = "authority", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
public string Authority { get; set; }
Property Value
Type | Description |
---|---|
string |
RedirectCode
On a redirect, Specifies the HTTP status code to use in the redirect response. The default response code is MOVED_PERMANENTLY (301).
Declaration
[JsonProperty(PropertyName = "redirectCode", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
public int? RedirectCode { get; set; }
Property Value
Type | Description |
---|---|
int? |
Uri
On a redirect, overwrite the Path portion of the URL with this value. Note that the entire path will be replaced, irrespective of the request URI being matched as an exact path or prefix.
Declaration
[JsonProperty(PropertyName = "uri", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
public string Uri { get; set; }
Property Value
Type | Description |
---|---|
string |
Methods
Validate()
Validate the object.
Declaration
public virtual void Validate()
Exceptions
Type | Condition |
---|---|
ValidationException | Thrown if validation fails. |