doc/rdoc/classes/RFuzz/HttpClient.src/M000011.html in rfuzz-0.6 vs doc/rdoc/classes/RFuzz/HttpClient.src/M000011.html in rfuzz-0.7

- old
+ new

@@ -8,27 +8,27 @@ <title>build_request (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 226</span> -226: <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>) -227: <span class="ruby-identifier">ops</span> = <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">req</span>) -228: <span class="ruby-identifier">query</span> = <span class="ruby-identifier">ops</span>[<span class="ruby-identifier">:query</span>] -229: -230: <span class="ruby-comment cmt"># merge head differently since that's typically what they mean</span> -231: <span class="ruby-identifier">head</span> = <span class="ruby-identifier">req</span>[<span class="ruby-identifier">:head</span>] <span class="ruby-operator">||</span> {} -232: <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>] + <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">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>) +231: <span class="ruby-identifier">ops</span> = <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">req</span>) +232: <span class="ruby-identifier">query</span> = <span class="ruby-identifier">ops</span>[<span class="ruby-identifier">:query</span>] 233: -234: <span class="ruby-comment cmt"># setup basic headers we always need</span> -235: <span class="ruby-identifier">head</span>[<span class="ruby-constant">HOST</span>] = <span class="ruby-identifier">encode_host</span>(<span class="ruby-ivar">@host</span>,<span class="ruby-ivar">@port</span>) -236: <span class="ruby-identifier">head</span>[<span class="ruby-constant">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> +234: <span class="ruby-comment cmt"># merge head differently since that's typically what they mean</span> +235: <span class="ruby-identifier">head</span> = <span class="ruby-identifier">req</span>[<span class="ruby-identifier">:head</span>] <span class="ruby-operator">||</span> {} +236: <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>] 237: -238: <span class="ruby-comment cmt"># blast it out</span> -239: <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>)]) -240: <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>)) -241: <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> {}))) -242: <span class="ruby-identifier">out</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">&quot;\r\n&quot;</span>) -243: <span class="ruby-identifier">ops</span>[<span class="ruby-identifier">:body</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;&quot;</span> -244: <span class="ruby-keyword kw">end</span></pre> +238: <span class="ruby-comment cmt"># setup basic headers we always need</span> +239: <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>) +240: <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> +241: +242: <span class="ruby-comment cmt"># blast it out</span> +243: <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>)]) +244: <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>)) +245: <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> {}))) +246: <span class="ruby-identifier">out</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">&quot;\r\n&quot;</span>) +247: <span class="ruby-identifier">ops</span>[<span class="ruby-identifier">:body</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;&quot;</span> +248: <span class="ruby-keyword kw">end</span></pre> </body> </html> \ No newline at end of file