Created
September 20, 2017 10:21
-
-
Save bongole/e052f11924601d0d5c4de349d48e1e7a to your computer and use it in GitHub Desktop.
test http tcp packets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'ethon' | |
require 'httpclient' | |
require 'net/http' | |
require 'uri' | |
url = 'http://example.com/' | |
dummy = 'a' * 2000 | |
# ethon | |
easy = Ethon::Easy.new | |
easy.headers = {'Expect' => nil} | |
easy.http_request(url, :post, body: 'ethon' + dummy) | |
easy.perform | |
# net/http | |
Net::HTTP.post URI(url), 'nethttp' + dummy | |
# httpclient | |
client = HTTPClient.new | |
client.post url, 'httpclient' + dummy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
net/httpだけ、ヘッダーと本文が別れたパケットで送られる