<commit_before># HTTP Responses

- [Basic Responses](#basic-responses)
	- [Attaching Headers To Responses](#attaching-headers-to-responses)
	- [Attaching Cookies To Responses](#attaching-cookies-to-responses)
- [Other Response Types](#other-response-types)
	- [View Responses](#view-responses)
	- [JSON Responses](#json-responses)
	- [File Downloads](#file-downloads)
- [Redirects](#redirects)
	- [Redirecting To Named Routes](#redirecting-named-routes)
	- [Redirecting To Controller Actions](#redirecting-controller-actions)
	- [Redirecting With Flashed Session Data](#redirecting-with-flashed-session-data)
- [Response Macros](#response-macros)

<a name="basic-responses"></a>
## Basic Responses

Of course, all routes and controllers should return some kind of response to be sent back to the user's browser. Laravel provdies several different ways to return responses. The most basic response is simply returning a string from a route or controller:

	Route::get('/', function () {
		return 'Hello World';
	});

The given string will automatically be converted into an HTTP response by the framework.
<commit_msg>fix typo<commit_after># HTTP Responses

- [Basic Responses](#basic-responses)
	- [Attaching Headers To Responses](#attaching-headers-to-responses)
	- [Attaching Cookies To Responses](#attaching-cookies-to-responses)
- [Other Response Types](#other-response-types)
	- [View Responses](#view-responses)
	- [JSON Responses](#json-responses)
	- [File Downloads](#file-downloads)
- [Redirects](#redirects)
	- [Redirecting To Named Routes](#redirecting-named-routes)
	- [Redirecting To Controller Actions](#redirecting-controller-actions)
	- [Redirecting With Flashed Session Data](#redirecting-with-flashed-session-data)
- [Response Macros](#response-macros)

<a name="basic-responses"></a>
## Basic Responses

Of course, all routes and controllers should return some kind of response to be sent back to the user's browser. Laravel provides several different ways to return responses. The most basic response is simply returning a string from a route or controller:

	Route::get('/', function () {
		return 'Hello World';
	});

The given string will automatically be converted into an HTTP response by the framework.

{'fraction_non_alphanumeric': 0.11664423508299686, 'fraction_numerical': 0.0, 'mean_word_length': 5.3352272727272725, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1817725', 'n_tokens_mistral': 671, 'n_tokens_neox': 621, 'n_words': 207}