doc/rdoc/classes/RFuzz/HttpClient.src/M000020.html in rfuzz-0.8 vs doc/rdoc/classes/RFuzz/HttpClient.src/M000020.html in rfuzz-0.9
- old
+ new
@@ -3,32 +3,23 @@
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
- <title>build_request (RFuzz::HttpClient)</title>
+ <title>new (RFuzz::HttpClient)</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
- <pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line 247</span>
-247: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">build_request</span>(<span class="ruby-identifier">out</span>, <span class="ruby-identifier">method</span>, <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">req</span>)
-248: <span class="ruby-identifier">ops</span> = <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">req</span>)
-249: <span class="ruby-identifier">query</span> = <span class="ruby-identifier">ops</span>[<span class="ruby-identifier">:query</span>]
-250:
-251: <span class="ruby-comment cmt"># merge head differently since that's typically what they mean</span>
-252: <span class="ruby-identifier">head</span> = <span class="ruby-identifier">req</span>[<span class="ruby-identifier">:head</span>] <span class="ruby-operator">||</span> {}
-253: <span class="ruby-identifier">head</span> = <span class="ruby-identifier">ops</span>[<span class="ruby-identifier">:head</span>].<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">head</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">ops</span>[<span class="ruby-identifier">:head</span>]
-254:
-255: <span class="ruby-comment cmt"># setup basic headers we always need</span>
-256: <span class="ruby-identifier">head</span>[<span class="ruby-constant">REQ_HOST</span>] = <span class="ruby-identifier">encode_host</span>(<span class="ruby-ivar">@host</span>,<span class="ruby-ivar">@port</span>)
-257: <span class="ruby-identifier">head</span>[<span class="ruby-constant">REQ_CONTENT_LENGTH</span>] = <span class="ruby-identifier">ops</span>[<span class="ruby-identifier">:body</span>] <span class="ruby-operator">?</span> <span class="ruby-identifier">ops</span>[<span class="ruby-identifier">:body</span>].<span class="ruby-identifier">length</span> <span class="ruby-operator">:</span> <span class="ruby-value">0</span>
-258:
-259: <span class="ruby-comment cmt"># blast it out</span>
-260: <span class="ruby-identifier">out</span>.<span class="ruby-identifier">write</span>(<span class="ruby-constant">HTTP_REQUEST_HEADER</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">method</span>, <span class="ruby-identifier">encode_query</span>(<span class="ruby-identifier">uri</span>,<span class="ruby-identifier">query</span>)])
-261: <span class="ruby-identifier">out</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">encode_headers</span>(<span class="ruby-identifier">head</span>))
-262: <span class="ruby-identifier">out</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">encode_cookies</span>(<span class="ruby-ivar">@cookies</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">req</span>[<span class="ruby-identifier">:cookies</span>] <span class="ruby-operator">||</span> {})))
-263: <span class="ruby-identifier">out</span>.<span class="ruby-identifier">write</span>(<span class="ruby-constant">CRLF</span>)
-264: <span class="ruby-identifier">ops</span>[<span class="ruby-identifier">:body</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">""</span>
-265: <span class="ruby-keyword kw">end</span></pre>
+ <pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line 230</span>
+230: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">host</span>, <span class="ruby-identifier">port</span>, <span class="ruby-identifier">options</span> = {})
+231: <span class="ruby-ivar">@options</span> = <span class="ruby-identifier">options</span>
+232: <span class="ruby-ivar">@host</span> = <span class="ruby-identifier">host</span>
+233: <span class="ruby-ivar">@port</span> = <span class="ruby-identifier">port</span>
+234: <span class="ruby-ivar">@cookies</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:cookies</span>] <span class="ruby-operator">||</span> {}
+235: <span class="ruby-ivar">@allowed_methods</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:allowed_methods</span>] <span class="ruby-operator">||</span> [<span class="ruby-identifier">:put</span>, <span class="ruby-identifier">:get</span>, <span class="ruby-identifier">:post</span>, <span class="ruby-identifier">:delete</span>, <span class="ruby-identifier">:head</span>]
+236: <span class="ruby-ivar">@notifier</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:notifier</span>]
+237: <span class="ruby-ivar">@redirect</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:redirect</span>] <span class="ruby-operator">||</span> <span class="ruby-keyword kw">false</span>
+238: <span class="ruby-ivar">@parser</span> = <span class="ruby-constant">HttpClientParser</span>.<span class="ruby-identifier">new</span>
+239: <span class="ruby-keyword kw">end</span></pre>
</body>
</html>
\ No newline at end of file