默认状态码为302,状态信息为"Found"。如果需要自定义状态码和状态信息,请使用SetStatusTResponse(TResponse, Int32, String)方法。
public static TResponse SetRedirect<TResponse>(
this TResponse response,
string url
)
where TResponse : HttpResponse
<ExtensionAttribute>
Public Shared Function SetRedirect(Of TResponse As HttpResponse) (
response As TResponse,
url As String
) As TResponse[<ExtensionAttribute>]
static member SetRedirect :
response : 'TResponse *
url : string -> 'TResponse when 'TResponse : HttpResponse