HttpResponse 클래스

정의

개별 HTTP 요청의 나가는 쪽을 나타냅니다.

public ref class HttpResponse abstract
public abstract class HttpResponse
type HttpResponse = class
Public MustInherit Class HttpResponse
상속
HttpResponse

생성자

HttpResponse()

개별 HTTP 요청의 나가는 쪽을 나타냅니다.

속성

Body

응답 본문 Stream을 가져오거나 설정합니다.

BodyWriter

응답 본문을 가져옵니다. PipeWriter

ContentLength

응답 헤더의 값을 Content-Length 가져오거나 설정합니다.

ContentType

응답 헤더의 값을 Content-Type 가져오거나 설정합니다.

Cookies

이 응답에 대한 쿠키를 관리하는 데 사용할 수 있는 개체를 가져옵니다.

HasStarted

응답 헤더가 클라이언트로 전송되었는지 여부를 나타내는 값을 가져옵니다.

Headers

응답 헤더를 가져옵니다.

HttpContext

이 응답에 대한 를 HttpContext 가져옵니다.

StatusCode

HTTP 응답 코드를 가져오거나 설정합니다.

메서드

CompleteAsync()

나머지 응답 헤더, 데이터 또는 트레일러를 플러시합니다. 응답이 Content-Length 불일치와 같은 잘못된 상태에 있는 경우 이 오류가 발생할 수 있습니다.

OnCompleted(Func<Object,Task>, Object)

응답이 클라이언트로 전송된 후 호출할 대리자를 추가합니다.

OnCompleted(Func<Task>)

응답이 클라이언트로 전송된 후 호출할 대리자를 추가합니다.

OnStarting(Func<Object,Task>, Object)

응답 헤더가 클라이언트로 전송되기 직전에 호출할 대리자를 추가합니다. 여기에 등록된 콜백은 역순으로 실행됩니다.

OnStarting(Func<Task>)

응답 헤더가 클라이언트로 전송되기 직전에 호출할 대리자를 추가합니다. 여기에 등록된 콜백은 역순으로 실행됩니다.

Redirect(String)

클라이언트에 대한 임시 리디렉션 응답(HTTP 302)을 반환합니다.

Redirect(String, Boolean)

클라이언트에 대한 리디렉션 응답(HTTP 301 또는 HTTP 302)을 반환합니다.

RegisterForDispose(IDisposable)

요청 처리가 완료되면 호스트에서 삭제할 개체를 등록합니다.

RegisterForDisposeAsync(IAsyncDisposable)

요청 처리가 완료되면 호스트가 비동기 삭제할 개체를 등록합니다.

StartAsync(CancellationToken)

OnStarting()을 호출하고 헤더를 수정할 수 없게 하여 응답을 시작합니다.

확장 메서드

GetTypedHeaders(HttpResponse)

강력한 형식의 HTTP 응답 헤더를 가져옵니다.

WriteAsJsonAsync(HttpResponse, Object, JsonTypeInfo, String, CancellationToken)

지정된 값을 응답 본문에 JSON으로 씁니다. 응답 콘텐츠 형식은 지정된 content-type으로 설정됩니다.

WriteAsJsonAsync(HttpResponse, Object, Type, JsonSerializerOptions, String, CancellationToken)

지정된 값을 응답 본문에 JSON으로 씁니다. 응답 콘텐츠 형식은 지정된 content-type으로 설정됩니다.

WriteAsJsonAsync(HttpResponse, Object, Type, JsonSerializerOptions, CancellationToken)

지정된 값을 응답 본문에 JSON으로 씁니다. 응답 콘텐츠 형식은 로 설정 application/json; charset=utf-8됩니다.

WriteAsJsonAsync(HttpResponse, Object, Type, JsonSerializerContext, String, CancellationToken)

지정된 값을 응답 본문에 JSON으로 씁니다. 응답 콘텐츠 형식은 지정된 content-type으로 설정됩니다.

WriteAsJsonAsync(HttpResponse, Object, Type, CancellationToken)

지정된 값을 응답 본문에 JSON으로 씁니다. 응답 콘텐츠 형식은 로 설정 application/json; charset=utf-8됩니다.

WriteAsJsonAsync<TValue>(HttpResponse, TValue, JsonSerializerOptions, String, CancellationToken)

지정된 값을 응답 본문에 JSON으로 씁니다. 응답 콘텐츠 형식은 지정된 content-type으로 설정됩니다.

WriteAsJsonAsync<TValue>(HttpResponse, TValue, JsonSerializerOptions, CancellationToken)

지정된 값을 응답 본문에 JSON으로 씁니다. 응답 콘텐츠 형식은 로 설정 application/json; charset=utf-8됩니다.

WriteAsJsonAsync<TValue>(HttpResponse, TValue, JsonTypeInfo<TValue>, String, CancellationToken)

지정된 값을 응답 본문에 JSON으로 씁니다. 응답 콘텐츠 형식은 지정된 content-type으로 설정됩니다.

WriteAsJsonAsync<TValue>(HttpResponse, TValue, CancellationToken)

지정된 값을 응답 본문에 JSON으로 씁니다. 응답 콘텐츠 형식은 로 설정 application/json; charset=utf-8됩니다.

WriteAsync(HttpResponse, String, Encoding, CancellationToken)

지정된 인코딩을 사용하여 지정된 텍스트를 응답 본문에 씁니다.

WriteAsync(HttpResponse, String, CancellationToken)

지정된 텍스트를 응답 본문에 씁니다. UTF-8 인코딩이 사용됩니다.

Clear(HttpResponse)

HTTP 응답을 지웁니다.

이 호출은 응답 헤더, 응답 상태 코드 및 응답 본문을 다시 설정합니다.

Redirect(HttpResponse, String, Boolean, Boolean)

클라이언트에 대한 리디렉션 응답(HTTP 301, HTTP 302, HTTP 307 또는 HTTP 308)을 반환합니다.

AppendTrailer(HttpResponse, String, StringValues)

응답 본문의 끝에 보낼 트레일러 컬렉션에 지정된 트레일러 헤더를 추가합니다. 확인 SupportsTrailers(HttpResponse) 또는 InvalidOperationException이 throw될 수 있습니다.

DeclareTrailer(HttpResponse, String)

지정된 트레일러 이름을 '트레일러' 응답 헤더에 추가합니다. 응답 헤더가 전송되기 전에 이 문제가 발생해야 합니다.

SupportsTrailers(HttpResponse)

서버가 이 응답에 대한 트레일러 헤더 전송을 지원하는지 나타냅니다.

SendFileAsync(HttpResponse, IFileInfo, Int64, Nullable<Int64>, CancellationToken)

SendFile 확장을 사용하여 지정된 파일을 보냅니다.

SendFileAsync(HttpResponse, IFileInfo, CancellationToken)

SendFile 확장을 사용하여 지정된 파일을 보냅니다.

SendFileAsync(HttpResponse, String, Int64, Nullable<Int64>, CancellationToken)

SendFile 확장을 사용하여 지정된 파일을 보냅니다.

SendFileAsync(HttpResponse, String, CancellationToken)

SendFile 확장을 사용하여 지정된 파일을 보냅니다.

적용 대상