File: //usr/local/rvm/gems/ruby-3.0.2/doc/actionpack-6.1.4.1/ri/ActionDispatch/Response/cdesc-Response.ri
U:RDoc::NormalClass[iI"
Response:ETI"ActionDispatch::Response;TI"Object;To:RDoc::Markup::Document:@parts[o;;[o:RDoc::Markup::Paragraph;[
I"MRepresents an HTTP response generated by a controller action. Use it to ;TI"Sretrieve the current state of the response, or customize the response. It can ;TI"Neither represent a real HTTP response (i.e. one that is meant to be sent ;TI"Lback to the web browser) or a TestResponse (i.e. one that is generated ;TI"from integration tests).;To:RDoc::Markup::BlankLine o; ;[
I"O\Response is mostly a Ruby on \Rails framework implementation detail, and ;TI"Nshould never be used directly in controllers. Controllers should use the ;TI"Qmethods defined in ActionController::Base instead. For example, if you want ;TI"<to set the HTTP response's content MIME type, then use ;TI">ActionControllerBase#headers instead of Response#headers.;T@o; ;[I"QNevertheless, integration tests may want to inspect controller responses in ;TI"Jmore detail, and that's when \Response can be useful for application ;TI"2developers. Integration test methods such as ;TI"2ActionDispatch::Integration::Session#get and ;TI"FActionDispatch::Integration::Session#post return objects of type ;TI"?TestResponse (which are of course also of type \Response).;T@o; ;[I"MFor example, the following demo integration test prints the body of the ;TI"(controller response to the console:;T@o:RDoc::Markup::Verbatim;[I"@class DemoControllerTest < ActionDispatch::IntegrationTest
;TI"+ def test_print_root_path_to_console
;TI" get('/')
;TI" puts response.body
;TI" end
;TI"end;T:@format0:
@fileI")lib/action_dispatch/http/response.rb;T:0@omit_headings_from_table_of_contents_below0;
0;0[
[
I"header;TI"R;T:publicFI")lib/action_dispatch/http/response.rb;T[
I"headers;T@5;F@6[
I"request;TI"RW;T;F@6[
I"status;T@5;F@6[
I"stream;T@5;F@6[U:RDoc::Constant[i I"CONTENT_TYPE;TI"+ActionDispatch::Response::CONTENT_TYPE;T;0o;;[ ;
@1;0@1@cRDoc::NormalClass0U;[i I"SET_COOKIE;TI")ActionDispatch::Response::SET_COOKIE;T;0o;;[ ;
@1;0@1@@G0U;[i I"
LOCATION;TI"'ActionDispatch::Response::LOCATION;T;0o;;[ ;
@1;0@1@@G0U;[i I"NO_CONTENT_CODES;TI"/ActionDispatch::Response::NO_CONTENT_CODES;T;0o;;[ ;
@1;0@1@@G0U;[i I"ContentTypeHeader;TI"0ActionDispatch::Response::ContentTypeHeader;T;0o;;[ ;
@1;0@1@@G0U;[i I"NullContentTypeHeader;TI"4ActionDispatch::Response::NullContentTypeHeader;T;0o;;[ ;
@1;0@1@@G0[ [I"Rack::Response::Helpers;To;;[ ;
@1;0@6[I")ActionDispatch::Http::FilterRedirect;To;;[ ;
@1;0@6[I"*ActionDispatch::Http::Cache::Response;To;;[ ;
@1;0@6[I"MonitorMixin;To;;[ ;
@1;0@6[[I"
class;T[[;[
[I"create;T@6[I"merge_default_headers;T@6[I"new;T@6[I"+return_only_media_type_on_content_type;T@6[I",return_only_media_type_on_content_type=;T@6[:protected[ [:private[ [I"
instance;T[[;[([I"
abort;T@6[I"await_commit;T@6[I"await_sent;T@6[I" body;T@6[I"
body=;T@6[I"body_parts;T@6[I"charset;T@6[I"
charset=;T@6[I"
close;T@6[I" code;T@6[I"commit!;T@6[I"committed?;T@6[I"content_type;T@6[I"content_type=;T@6[I"cookies;T@6[I"delete_header;T@6[I" each;T@6[I"get_header;T@6[I"has_header?;T@6[I"media_type;T@6[I"message;T@6[I"
prepare!;T@6[I"reset_body!;T@6[I"response_code;T@6[I"send_file;T@6[I"
sending!;T@6[I"
sending?;T@6[I"sending_file=;T@6[I"
sent!;T@6[I"
sent?;T@6[I"set_header;T@6[I"status=;T@6[I"status_message;T@6[I" to_a;T@6[I"
write;T@6[;[ [;[[I"-assign_default_content_type_and_charset!;T@6[I"before_committed;T@6[I"before_sending;T@6[I"build_buffer;T@6[I"handle_no_content!;T@6[I"munge_body_object;T@6[I"parse_content_type;T@6[I"parsed_content_type_header;T@6[I"rack_response;T@6[I"set_content_type;T@6[ [U:RDoc::Context::Section[i 0o;;[ ;
0;0[@1I"ActionDispatch;TcRDoc::NormalModule