Sha256: e65e9a57f7b2e22b521dd8934fd92baf6443f5c0dc1ae54a9c31fadc2fa6fc34

Contents?: true

Size: 1.91 KB

Versions: 1

Compression:

Stored size: 1.91 KB

Contents

<p>
This is a tutorial for capturing http requests for modification and/or
resubmission at a later date.  First, get the environment right:
</p>

<ul>
<li>Be sure you're viewing this in <a href="http://www.mozilla.com/en-US/firefox/">Firefox</a></li>
<li>Install <a href="http://labs.mozilla.com/2008/08/introducing-ubiquity/">Ubiquity</a></li>
<li>Subscribe to the redirect-http command on this page</li>
</ul>

<p>
Now capture the request from this page (use the same procedure wherever
else you need to capture the parameters of a form):
</p>

<ul>
<li>Bring up Ubiquity in Firefox by pressing 'option+space'</li>
<li>Enter the command: redirect_http</li>
</ul>

<p>
You should now see some notification that you're redirecting this page.
Write what you want to say, hit submit, and you'll be asked to save a
configuration file for the request.  Save it, then on the command line
execute this:
</p>

<pre><code>  % tap run -- load/yaml --:s submit --: dump &lt; request.yml</code></pre>

<p>
The request will be submitted and you'll get a printout of the response
body. To prove everything worked right, click the close link in the
redirection bar and resubmit the form.
</p>

<a href="/capture/say?words=link+was+clicked">Link</a>
<form action='/capture/say'>
Form: <input name='words' value="form was submitted"/>
<input type="submit" value="submit" />
</form>

<p>
Redirection occurs via the on-click and on-submit callbacks for links and
forms, respectively.  The existing behavior is preserved, as can be
demonstrated below:
</p>

<pre>
  &lt;form action='/capture/say' onsubmit='alert("Form was submitted!")'>
</pre>

<a href="/capture/say?words=link+was+clicked" onclick='alert("Link was clicked!")'>Link with OnClick</a>
<form action='/capture/say' onsubmit='alert("Form was submitted!")'>
Form with OnSubmit: <input name='words' value="form was submitted"/>
<input type="submit" value="submit" />
</form>

<%= command_link uri(:command) %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tap-mechanize-0.6.0 views/tap/mechanize/capture/tutorial.erb