<commit_before># curl

Download content from the Internet.

Alternative to `wget`.


## Download content

Print to `stdout`:

	curl http://example.com/index.html

Save a file:

	curl http://example.com/ > index.html


## Print HTTP headers and content (-i)

	curl -i http://example.com/index.html

First line should be `HTTP/1.1 200 OK` if the request worked.<commit_msg>Add HTTP methods to curl<commit_after># curl

Download content from the Internet.

Alternative to `wget`.


## Download content

Print to `stdout`:

	curl http://example.com/index.html

Save a file:

	curl http://example.com/ > index.html


## HTTP methods

Method names must be specified in uppercase!

Delete all documents in Elasticsearch:

	curl --request DELETE http://localhost:9200/my_index/my_document_type/

or

	curl -X DELETE http://localhost:9200/my_index/my_document_type/


## Print HTTP headers and content (-i)

	curl -i http://example.com/index.html

First line should be `HTTP/1.1 200 OK` if the request worked.
{'fraction_non_alphanumeric': 0.109, 'fraction_numerical': 0.018, 'mean_word_length': 3.655813953488372, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6400039', 'n_tokens_mistral': 345, 'n_tokens_neox': 310, 'n_words': 112}