diamond-mechanize 2.2 → 2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (147) hide show
  1. data/Rakefile +49 -0
  2. data/lib/mechanize.rb +1079 -0
  3. data/lib/mechanize/content_type_error.rb +13 -0
  4. data/lib/mechanize/cookie.rb +232 -0
  5. data/lib/mechanize/cookie_jar.rb +194 -0
  6. data/lib/mechanize/download.rb +59 -0
  7. data/lib/mechanize/element_matcher.rb +36 -0
  8. data/lib/mechanize/file.rb +65 -0
  9. data/lib/mechanize/file_connection.rb +17 -0
  10. data/lib/mechanize/file_request.rb +26 -0
  11. data/lib/mechanize/file_response.rb +74 -0
  12. data/lib/mechanize/file_saver.rb +39 -0
  13. data/lib/mechanize/form.rb +543 -0
  14. data/lib/mechanize/form/button.rb +6 -0
  15. data/lib/mechanize/form/check_box.rb +12 -0
  16. data/lib/mechanize/form/field.rb +54 -0
  17. data/lib/mechanize/form/file_upload.rb +21 -0
  18. data/lib/mechanize/form/hidden.rb +3 -0
  19. data/lib/mechanize/form/image_button.rb +19 -0
  20. data/lib/mechanize/form/keygen.rb +34 -0
  21. data/lib/mechanize/form/multi_select_list.rb +94 -0
  22. data/lib/mechanize/form/option.rb +50 -0
  23. data/lib/mechanize/form/radio_button.rb +55 -0
  24. data/lib/mechanize/form/reset.rb +3 -0
  25. data/lib/mechanize/form/select_list.rb +44 -0
  26. data/lib/mechanize/form/submit.rb +3 -0
  27. data/lib/mechanize/form/text.rb +3 -0
  28. data/lib/mechanize/form/textarea.rb +3 -0
  29. data/lib/mechanize/headers.rb +23 -0
  30. data/lib/mechanize/history.rb +82 -0
  31. data/lib/mechanize/http.rb +8 -0
  32. data/lib/mechanize/http/agent.rb +1004 -0
  33. data/lib/mechanize/http/auth_challenge.rb +59 -0
  34. data/lib/mechanize/http/auth_realm.rb +31 -0
  35. data/lib/mechanize/http/content_disposition_parser.rb +188 -0
  36. data/lib/mechanize/http/www_authenticate_parser.rb +155 -0
  37. data/lib/mechanize/monkey_patch.rb +16 -0
  38. data/lib/mechanize/page.rb +440 -0
  39. data/lib/mechanize/page/base.rb +7 -0
  40. data/lib/mechanize/page/frame.rb +27 -0
  41. data/lib/mechanize/page/image.rb +30 -0
  42. data/lib/mechanize/page/label.rb +20 -0
  43. data/lib/mechanize/page/link.rb +98 -0
  44. data/lib/mechanize/page/meta_refresh.rb +68 -0
  45. data/lib/mechanize/parser.rb +173 -0
  46. data/lib/mechanize/pluggable_parsers.rb +144 -0
  47. data/lib/mechanize/redirect_limit_reached_error.rb +19 -0
  48. data/lib/mechanize/redirect_not_get_or_head_error.rb +21 -0
  49. data/lib/mechanize/response_code_error.rb +21 -0
  50. data/lib/mechanize/response_read_error.rb +27 -0
  51. data/lib/mechanize/robots_disallowed_error.rb +28 -0
  52. data/lib/mechanize/test_case.rb +663 -0
  53. data/lib/mechanize/unauthorized_error.rb +3 -0
  54. data/lib/mechanize/unsupported_scheme_error.rb +6 -0
  55. data/lib/mechanize/util.rb +101 -0
  56. data/test/data/htpasswd +1 -0
  57. data/test/data/server.crt +16 -0
  58. data/test/data/server.csr +12 -0
  59. data/test/data/server.key +15 -0
  60. data/test/data/server.pem +15 -0
  61. data/test/htdocs/alt_text.html +10 -0
  62. data/test/htdocs/bad_form_test.html +9 -0
  63. data/test/htdocs/button.jpg +0 -0
  64. data/test/htdocs/canonical_uri.html +9 -0
  65. data/test/htdocs/dir with spaces/foo.html +1 -0
  66. data/test/htdocs/empty_form.html +6 -0
  67. data/test/htdocs/file_upload.html +26 -0
  68. data/test/htdocs/find_link.html +41 -0
  69. data/test/htdocs/form_multi_select.html +16 -0
  70. data/test/htdocs/form_multival.html +37 -0
  71. data/test/htdocs/form_no_action.html +18 -0
  72. data/test/htdocs/form_no_input_name.html +16 -0
  73. data/test/htdocs/form_order_test.html +11 -0
  74. data/test/htdocs/form_select.html +16 -0
  75. data/test/htdocs/form_set_fields.html +14 -0
  76. data/test/htdocs/form_test.html +188 -0
  77. data/test/htdocs/frame_referer_test.html +10 -0
  78. data/test/htdocs/frame_test.html +30 -0
  79. data/test/htdocs/google.html +13 -0
  80. data/test/htdocs/index.html +6 -0
  81. data/test/htdocs/link with space.html +5 -0
  82. data/test/htdocs/meta_cookie.html +11 -0
  83. data/test/htdocs/no_title_test.html +6 -0
  84. data/test/htdocs/noindex.html +9 -0
  85. data/test/htdocs/rails_3_encoding_hack_form_test.html +27 -0
  86. data/test/htdocs/relative/tc_relative_links.html +21 -0
  87. data/test/htdocs/robots.html +8 -0
  88. data/test/htdocs/robots.txt +2 -0
  89. data/test/htdocs/tc_bad_charset.html +9 -0
  90. data/test/htdocs/tc_bad_links.html +5 -0
  91. data/test/htdocs/tc_base_link.html +8 -0
  92. data/test/htdocs/tc_blank_form.html +11 -0
  93. data/test/htdocs/tc_charset.html +6 -0
  94. data/test/htdocs/tc_checkboxes.html +19 -0
  95. data/test/htdocs/tc_encoded_links.html +5 -0
  96. data/test/htdocs/tc_field_precedence.html +11 -0
  97. data/test/htdocs/tc_follow_meta.html +8 -0
  98. data/test/htdocs/tc_form_action.html +48 -0
  99. data/test/htdocs/tc_links.html +19 -0
  100. data/test/htdocs/tc_meta_in_body.html +9 -0
  101. data/test/htdocs/tc_pretty_print.html +17 -0
  102. data/test/htdocs/tc_referer.html +16 -0
  103. data/test/htdocs/tc_relative_links.html +19 -0
  104. data/test/htdocs/tc_textarea.html +23 -0
  105. data/test/htdocs/test_click.html +11 -0
  106. data/test/htdocs/unusual______.html +5 -0
  107. data/test/test_mechanize.rb +1164 -0
  108. data/test/test_mechanize_cookie.rb +451 -0
  109. data/test/test_mechanize_cookie_jar.rb +483 -0
  110. data/test/test_mechanize_download.rb +43 -0
  111. data/test/test_mechanize_file.rb +61 -0
  112. data/test/test_mechanize_file_connection.rb +21 -0
  113. data/test/test_mechanize_file_request.rb +19 -0
  114. data/test/test_mechanize_file_saver.rb +21 -0
  115. data/test/test_mechanize_form.rb +875 -0
  116. data/test/test_mechanize_form_check_box.rb +38 -0
  117. data/test/test_mechanize_form_encoding.rb +114 -0
  118. data/test/test_mechanize_form_field.rb +63 -0
  119. data/test/test_mechanize_form_file_upload.rb +20 -0
  120. data/test/test_mechanize_form_image_button.rb +12 -0
  121. data/test/test_mechanize_form_keygen.rb +32 -0
  122. data/test/test_mechanize_form_multi_select_list.rb +84 -0
  123. data/test/test_mechanize_form_option.rb +55 -0
  124. data/test/test_mechanize_form_radio_button.rb +78 -0
  125. data/test/test_mechanize_form_select_list.rb +76 -0
  126. data/test/test_mechanize_form_textarea.rb +52 -0
  127. data/test/test_mechanize_headers.rb +35 -0
  128. data/test/test_mechanize_history.rb +103 -0
  129. data/test/test_mechanize_http_agent.rb +1225 -0
  130. data/test/test_mechanize_http_auth_challenge.rb +39 -0
  131. data/test/test_mechanize_http_auth_realm.rb +49 -0
  132. data/test/test_mechanize_http_content_disposition_parser.rb +118 -0
  133. data/test/test_mechanize_http_www_authenticate_parser.rb +146 -0
  134. data/test/test_mechanize_link.rb +80 -0
  135. data/test/test_mechanize_page.rb +118 -0
  136. data/test/test_mechanize_page_encoding.rb +182 -0
  137. data/test/test_mechanize_page_frame.rb +16 -0
  138. data/test/test_mechanize_page_link.rb +390 -0
  139. data/test/test_mechanize_page_meta_refresh.rb +127 -0
  140. data/test/test_mechanize_parser.rb +289 -0
  141. data/test/test_mechanize_pluggable_parser.rb +52 -0
  142. data/test/test_mechanize_redirect_limit_reached_error.rb +24 -0
  143. data/test/test_mechanize_redirect_not_get_or_head_error.rb +14 -0
  144. data/test/test_mechanize_subclass.rb +22 -0
  145. data/test/test_mechanize_util.rb +103 -0
  146. data/test/test_multi_select.rb +119 -0
  147. metadata +148 -71
@@ -0,0 +1,3 @@
1
+ class Mechanize::UnauthorizedError < Mechanize::ResponseCodeError
2
+ end
3
+
@@ -0,0 +1,6 @@
1
+ class Mechanize::UnsupportedSchemeError < Mechanize::Error
2
+ attr_accessor :scheme
3
+ def initialize(scheme)
4
+ @scheme = scheme
5
+ end
6
+ end
@@ -0,0 +1,101 @@
1
+ require 'cgi'
2
+
3
+ class Mechanize::Util
4
+ CODE_DIC = {
5
+ :JIS => "ISO-2022-JP",
6
+ :EUC => "EUC-JP",
7
+ :SJIS => "SHIFT_JIS",
8
+ :UTF8 => "UTF-8", :UTF16 => "UTF-16", :UTF32 => "UTF-32"}
9
+
10
+ # true if RUBY_VERSION is 1.9.0 or later
11
+ NEW_RUBY_ENCODING = RUBY_VERSION >= '1.9.0'
12
+
13
+ # contains encoding error classes to raise
14
+ ENCODING_ERRORS = if NEW_RUBY_ENCODING
15
+ [EncodingError]
16
+ else
17
+ [Iconv::InvalidEncoding, Iconv::IllegalSequence]
18
+ end
19
+
20
+ def self.build_query_string(parameters, enc=nil)
21
+ parameters.map { |k,v|
22
+ # WEBrick::HTTP.escape* has some problems about m17n on ruby-1.9.*.
23
+ [CGI.escape(k.to_s), CGI.escape(v.to_s)].join("=") if k
24
+ }.compact.join('&')
25
+ end
26
+
27
+ # Converts string +s+ from +code+ to UTF-8.
28
+ def self.from_native_charset(s, code, ignore_encoding_error=false, log=nil)
29
+ return s unless s && code
30
+ return s unless Mechanize.html_parser == Nokogiri::HTML
31
+
32
+ begin
33
+ encode_to(code, s)
34
+ rescue *ENCODING_ERRORS => ex
35
+ log.debug("from_native_charset: #{ex.class}: form encoding: #{code.inspect} string: #{s}") if log
36
+ if ignore_encoding_error
37
+ s
38
+ else
39
+ raise
40
+ end
41
+ end
42
+ end
43
+
44
+ # inner convert method of Util.from_native_charset
45
+ def self.encode_to(encoding, str)
46
+ if NEW_RUBY_ENCODING
47
+ str.encode(encoding)
48
+ else
49
+ Iconv.conv(encoding.to_s, "UTF-8", str)
50
+ end
51
+ end
52
+ private_class_method :encode_to
53
+
54
+ def self.html_unescape(s)
55
+ return s unless s
56
+ s.gsub(/&(\w+|#[0-9]+);/) { |match|
57
+ number = case match
58
+ when /&(\w+);/
59
+ Mechanize.html_parser::NamedCharacters[$1]
60
+ when /&#([0-9]+);/
61
+ $1.to_i
62
+ end
63
+
64
+ number ? ([number].pack('U') rescue match) : match
65
+ }
66
+ end
67
+
68
+ def self.detect_charset(src)
69
+ tmp = NKF.guess(src || "<html></html>")
70
+ if RUBY_VERSION >= "1.9.0"
71
+ enc = tmp.to_s.upcase
72
+ else
73
+ enc = NKF.constants.find{|c|
74
+ NKF.const_get(c) == tmp
75
+ }
76
+ enc = CODE_DIC[enc.intern]
77
+ end
78
+ enc || "ISO-8859-1"
79
+ end
80
+
81
+ def self.uri_escape str
82
+ @parser ||= begin
83
+ URI::Parser.new
84
+ rescue NameError
85
+ URI
86
+ end
87
+
88
+ @parser.escape str
89
+ end
90
+
91
+ def self.uri_unescape str
92
+ @parser ||= begin
93
+ URI::Parser.new
94
+ rescue NameError
95
+ URI
96
+ end
97
+
98
+ @parser.unescape str
99
+ end
100
+
101
+ end
@@ -0,0 +1 @@
1
+ mech:44E/qORekFV0E
@@ -0,0 +1,16 @@
1
+ -----BEGIN CERTIFICATE-----
2
+ MIICmzCCAgQCCQDq2kM3TCIM0DANBgkqhkiG9w0BAQQFADCBkTELMAkGA1UEBhMC
3
+ VVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1NlYXR0bGUxEjAQBgNV
4
+ BAoTCU1lY2hhbml6ZTESMBAGA1UECxMJTWVjaGFuaXplMQ4wDAYDVQQDEwVBYXJv
5
+ bjEjMCEGCSqGSIb3DQEJARYUYWFyb25wQHJ1Ynlmb3JnZS5vcmcwHhcNMDYwODIz
6
+ MDU0NTMwWhcNMDcwODIzMDU0NTMwWjCBkTELMAkGA1UEBhMCVVMxEzARBgNVBAgT
7
+ Cldhc2hpbmd0b24xEDAOBgNVBAcTB1NlYXR0bGUxEjAQBgNVBAoTCU1lY2hhbml6
8
+ ZTESMBAGA1UECxMJTWVjaGFuaXplMQ4wDAYDVQQDEwVBYXJvbjEjMCEGCSqGSIb3
9
+ DQEJARYUYWFyb25wQHJ1Ynlmb3JnZS5vcmcwgZ8wDQYJKoZIhvcNAQEBBQADgY0A
10
+ MIGJAoGBAKpnmI4Y4tB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RIVATE KEY-----
2
+ MIICXAIBAAKBgQCqZ5iOGOLQc90ibB0dvEKFK+yGMZKmw/Ko6oCDdC1zrJchcohs
3
+ zSnGuS59gLvAmS8groLf77rY31fhKtG5dB8GynaOh4z+kcZhl+hCll+zTq7KH/rP
4
+ eg4S5iWllm7b6j/HssvTzSJyo1+p/+8LFXrULrY4Tcv3AJK4elDrI8ghrwIDAQAB
5
+ AoGAC+iZfLS4hSDTv2gW0NErROtA6E/mk8j12GArAwTHeGIDXc8HQbNEzCJ84UBx
6
+ 3o/V/06yzruOL0HMfmvjpDY9RLsH02xZb2F/lruw4MJLu50i/Zu8Sjmb1YPSfCh/
7
+ 3+8lREA3Uznlq+wHC3yPxQzMBy5jaEdH4IKxT0Bq8TeF0AECQQDSpL47YpRVRsLn
8
+ sS00ndEgQQmT5AJWJJtPpbHk6AA0a+zdNeuDRbdF42zG483YEqU7meZbPKR8QbkK
9
+ ZQPEBuevAkEAzxjGcz6NZesmN/NQOtOpylewEs1bdIJyBIBmcnmkimLBtdxd0t34
10
+ wUKVHLDSj2aemuAHHwsyn/BNXs6F+obmAQJBALpbkAXAAFW1xefvo3vih8sOXyfd
11
+ WIfX2SRNBqbq7otyVFudQaChBDUrsOgBUPLyBAdH8DoV27wm9UuR9RPvu/cCQFRr
12
+ WgICXqtMFtE56tuACreD1S9k7MHqpsW0/Y3ujicnKKWUhd5+Q3esR5JhdgOkpkSl
13
+ y+FYtDNERpW+BBliwgECQA+Vc7pnxwDIOP8kFumdAUmRmhEZjuwArFcywPzrCUn9
14
+ 4/KBOp5wDN7kanBwNGZCZ/eQtkb6thAS8C9pufHD1lw=
15
+ -----END RSA PRIVATE KEY-----
@@ -0,0 +1,10 @@
1
+ <html>
2
+ <meta http-equiv="Refresh" content="0; url=http://www.drphil.com/">
3
+ <body>
4
+ <a href="alt_text.html"><img alt="alt text" src="hello"></a>
5
+ <a href="no_alt_text.html"><img src="hello"></a>
6
+ <a href="nil_alt_text.html"><img alt src="hello"></a>
7
+ <a href="no_image.html">no image</a>
8
+ <a href="no_text.html"></a>
9
+ </body>
10
+ </html>
@@ -0,0 +1,9 @@
1
+ <html>
2
+ <head><title>Page Title</title></head>
3
+ <body>
4
+ <form name="form" method="duh" action="/form_post">
5
+ <input name="first" type="text" />
6
+ <input type="submit" value="Submit" />
7
+ </form>
8
+ </body>
9
+ </html>
Binary file
@@ -0,0 +1,9 @@
1
+ <html>
2
+ <head>
3
+ <link rel="start" title="site top" href="/" />
4
+ <link rel="canonical" href="http://localhost/canonical_uri" />
5
+ </head>
6
+ <body>
7
+ test
8
+ </body>
9
+ </html>
@@ -0,0 +1,6 @@
1
+ <html>
2
+ <body>
3
+ <form>
4
+ </form>
5
+ </body>
6
+ </html>
@@ -0,0 +1,26 @@
1
+ <html>
2
+ <head>
3
+ <title>File Upload Form</title>
4
+ </head>
5
+ <body>
6
+ <h1>File Upload Test</h1>
7
+ <form enctype="multipart/form-data" action="/file_upload" method="post">
8
+ Your name: <input type="text" name="name" /><br />
9
+ File to process: <input name="userfile1" type="file" /><br />
10
+ <input type="text" name="foo[aaron]" value="test" />
11
+ <select name="foo">
12
+ </select>
13
+ <input type="submit" value="Send File" />
14
+ </form>
15
+ <form enctype="multipart/form-data" action="/file_upload" method="post">
16
+ Your name: <input type="text" name="name" /><br />
17
+ File to process: <input name="green[eggs]" type="file" /><br />
18
+ <input type="submit" value="Send File" />
19
+ </form>
20
+ <form enctype="multipart/form-data" action="/file_upload" name="value_test" method="post">
21
+ Your name: <input type="text" name="name" /><br />
22
+ File to process: <input name="green[eggs]" value="/etc/hosts" type="file" /><br />
23
+ <input type="submit" value="Send File" />
24
+ </form>
25
+ </body>
26
+ </html>
@@ -0,0 +1,41 @@
1
+ <html>
2
+ <head>
3
+ <meta http_equiv="Refresh" content="0; url=http://www.incorrect.com">
4
+ <meta http-equiv="Rfresh" content="0; url=http://www.also-wrong.com">
5
+ <meta http-equiv="Refresh" content="0; url=http://www.drphil.com/">
6
+ <meta http-equiv="Refresh" content="0; url='http://tenderlovemaking.com/'">
7
+ <META HTTP-EQUIV="REFRESH" CONTENT="0; URL=HTTP://WWW.UPCASE.COM/">
8
+ <TITLE>Testing the links</TITLE>
9
+ </head>
10
+ <body>
11
+ <A HREF="http://blargle.com/">blargle</A>
12
+ <A HREF="http://a.cpan.org/">CPAN A</A>
13
+ <A HREF="http://b.cpan.org/">CPAN B</A>
14
+ <FRAME SRC="foo.html">
15
+ <FRAME SRC="bar.html">
16
+ <A HREF="http://c.cpan.org/" NAME="bongo">CPAN C</A>
17
+ <A HREF="http://d.cpan.org/">CPAN D</A>
18
+
19
+ <A HREF="http://www.msnbc.com/">MSNBC</A>
20
+ <FRAME SRC="http://www.oreilly.com/" NAME="wongo">
21
+ <A HREF="http://www.cnn.com/">CNN</A>
22
+ <A HREF="http://www.bbc.co.uk/" NAME="Wilma">BBC</A>
23
+ <A HREF="http://www.msnbc.com/">News</A>
24
+ <A HREF="http://www.cnn.com/" NAME="Fred">News</A>
25
+ <A HREF="http://www.bbc.co.uk/">News</A>
26
+ <A onmouseover="window.status='Rebuild Files'; return true" href="#" onClick="window.open( '/cgi-bin/MT/mt.cgi', 'rebuild', 'width=400,height=200,resizable=yes')">Rebuild Index</A>
27
+
28
+ <MAP NAME="SOME_MAP">
29
+ <AREA HREF="http://www.msnbc.com/area" COORDS="1,2,3,4"></AREA>
30
+ <AREA HREF="http://www.cnn.com/area" COORDS="5,6,7,8" NAME="Marty">
31
+ <AREA HREF="http://www.cpan.org/area" COORDS="10,11,12,13" />
32
+ </MAP>
33
+ <IMG SRC="SOME_IMAGE" USEMAP="#SOME_MAP">
34
+
35
+ <!-- new stuff -->
36
+ <A HREF="http://nowhere.org/" Name="Here">NoWhere</A>
37
+ <A HREF="http://nowhere.org/padded" Name=" Here "> NoWhere </A>
38
+ <A HREF="blongo.html">Blongo!</A>
39
+ </body>
40
+ </html>
41
+
@@ -0,0 +1,16 @@
1
+ <html>
2
+ <body>
3
+ <form name="form1" method="post" action="/form_post">
4
+ <select name="list" multiple size="3">
5
+ <option value="1">Option 1</option>
6
+ <option value="2" selected>Option 2</option>
7
+ <option value="3">Option 3</option>
8
+ <option value="4">Option 4</option>
9
+ <option value="5">Option 5</option>
10
+ <option value="6">Option 6</option>
11
+ </select>
12
+ <br />
13
+ <input type="submit" value="Submit" />
14
+ </form>
15
+ </body>
16
+ </html>
@@ -0,0 +1,37 @@
1
+ <html>
2
+ <head><title>Page Title</title></head>
3
+ <body>
4
+ <form name="post_form" id="user_post_form" method="post" action="/form_post">
5
+ <table>
6
+ <tr>
7
+ <td>First Name</td>
8
+ <td><input name="first" type="text" id="name_first" /></td>
9
+ </tr>
10
+ <tr>
11
+ <td>First Name Again</td>
12
+ <td><input name="first" type="text" /></td>
13
+ </tr>
14
+ <tr>
15
+ <td><input type="submit" value="Submit" /></td>
16
+ <td></td>
17
+ </tr>
18
+ </table>
19
+ </form>
20
+ <form name="get_form" method="get" action="/form_post">
21
+ <table>
22
+ <tr>
23
+ <td>First Name</td>
24
+ <td><input name="first" type="text" /></td>
25
+ </tr>
26
+ <tr>
27
+ <td>First Name Again</td>
28
+ <td><input name="first" type="text" /></td>
29
+ </tr>
30
+ <tr>
31
+ <td><input type="submit" value="Submit" /></td>
32
+ <td></td>
33
+ </tr>
34
+ </table>
35
+ </form>
36
+ </body>
37
+ </html>
@@ -0,0 +1,18 @@
1
+ <html>
2
+ <head><title>Page Title</title></head>
3
+ <body>
4
+ <form name="get_form" method="get">
5
+ <table>
6
+ <tr>
7
+ <td>First Name</td>
8
+ <td><input name="first" type="text" /></td>
9
+ </tr>
10
+ <tr>
11
+ <td><input type="submit" value="Submit" /></td>
12
+ <td></td>
13
+ </tr>
14
+ </table>
15
+ </form>
16
+ </body>
17
+ </html>
18
+
@@ -0,0 +1,16 @@
1
+ <html>
2
+ <head><title>Input with no name</title></head>
3
+ <body>
4
+ <form name="test" action="/form_post" method="post">
5
+ <input type="text" /><br />
6
+ <input type="password" /><br />
7
+ <input type="hidden" /><br />
8
+ <input type="radio" /><br />
9
+ <input type="checkbox" /><br />
10
+ <input type="file" /><br />
11
+ <textarea></textarea>
12
+ <select></select>
13
+ <input type="submit" />
14
+ </form>
15
+ </body>
16
+ </html>
@@ -0,0 +1,11 @@
1
+ <html>
2
+ <head><title>Page Title</title></head>
3
+ <body>
4
+ <form name="post_form1">
5
+ <input type="radio" name="1" value="RADIO" checked>
6
+ <input type="email" name="3" value="nobody@example">
7
+ <input type="text" name="2" value="TEXT">
8
+ <input type="month" name="3" value="2011-10">
9
+ </form>
10
+ </body>
11
+ </html>
@@ -0,0 +1,16 @@
1
+ <html>
2
+ <body>
3
+ <form name="form1" method="post" action="/form_post">
4
+ <select name="list">
5
+ <option value="1">Option 1</option>
6
+ <option value="2" selected>Option 2</option>
7
+ <option value="3">Option 3</option>
8
+ <option value="4">Option 4</option>
9
+ <option value="5">Option 5</option>
10
+ <option value="6">Option 6</option>
11
+ </select>
12
+ <br />
13
+ <input type="submit" value="Submit" />
14
+ </form>
15
+ </body>
16
+ </html>
@@ -0,0 +1,14 @@
1
+ <html>
2
+ <head>
3
+ <title>HTML for tc_set_fields</title>
4
+ </head>
5
+ <body>
6
+ <form name="set_fields" method="post" action="/form_post">
7
+ <input type="text" name="first_name" /><br />
8
+ <input type="text" name="first_name" /><br />
9
+ <input type="text" name="gender" /><br />
10
+ <input type="text" name="green[eggs]" /><br />
11
+ <input type="submit" value="Submit" /><br />
12
+ </form>
13
+ </body>
14
+ </html>
@@ -0,0 +1,188 @@
1
+ <html>
2
+ <head><title>Page Title</title></head>
3
+ <body>
4
+ <h1>Post Form 1</h1>
5
+ <form name="post_form1" method="post" action="/form_post" id="generic_form" class="really_generic_form" >
6
+ <table>
7
+ <tr>
8
+ <td>First Name</td>
9
+ <td><input type="text" name="first_name" id="name_first" class="text_input"/></td>
10
+ </tr>
11
+ <tr>
12
+ <td>Gender</td>
13
+ <td>
14
+ M: <input type="radio" name="gender" value="male" /><br />
15
+ F: <input type="radio" name="gender" value="female" /><br />
16
+ </td>
17
+ </tr>
18
+ <tr>
19
+ <td>Check this if you are cool:</td>
20
+ <td><input type="checkbox" name="cool person" /></td>
21
+ </tr>
22
+ <tr>
23
+ <td>Check this if you like green eggs:</td>
24
+ <td><input type="checkbox" name="green[eggs]" /></td>
25
+ </tr>
26
+ <tr>
27
+ <td>Check this if you like ham:</td>
28
+ <td><input type="checkbox" name="likes ham" /></td>
29
+ </tr>
30
+ </table><br />
31
+ <select name="country">
32
+ <option value="USA">USA</option>
33
+ <option value="CANADA">CANADA</option>
34
+ </select><br />
35
+ <select name="empty">
36
+ </select><br />
37
+ <input type="submit" value="Submit" />
38
+ </form>
39
+ <h1>Get Form 1</h1>
40
+ <form name="get_form1" method="get" action="/form_post">
41
+ <table>
42
+ <tr>
43
+ <td>First Name</td>
44
+ <td><input type="text" name="first_name" /></td>
45
+ </tr>
46
+ <tr>
47
+ <td>Gender</td>
48
+ <td>
49
+ M: <input type="radio" name="gender" value="male" /><br />
50
+ F: <input type="radio" name="gender" value="female" /><br />
51
+ </td>
52
+ </tr>
53
+ <tr>
54
+ <td>Check this if you are cool:</td>
55
+ <td><input type="checkbox" name="cool person" /></td>
56
+ </tr>
57
+ <tr>
58
+ <td>Check this if you like green eggs:</td>
59
+ <td><input type="checkbox" name="green[eggs]" /></td>
60
+ </tr>
61
+ <tr>
62
+ <td>Check this if you like ham:</td>
63
+ <td><input type="checkbox" name="likes ham" /></td>
64
+ </tr>
65
+ </table><br />
66
+ <input type="image" name="button" value="button" src="button.jpg" />
67
+ <input type="submit" value="Submit" />
68
+ </form>
69
+
70
+ <!-- Get ant post to a form with a space in the name -->
71
+ <h1>Post Form 2</h1>
72
+ <form name="post_form2" method="post" action="/form post">
73
+ <table>
74
+ <tr>
75
+ <td>First Name</td>
76
+ <td><input type="text" name="first_name" /></td>
77
+ </tr>
78
+ <tr>
79
+ <td>Gender</td>
80
+ <td>
81
+ M: <input type="radio" name="gender" value="male" /><br />
82
+ F: <input type="radio" name="gender" value="female" /><br />
83
+ </td>
84
+ </tr>
85
+ <tr>
86
+ <td>Check this if you are cool:</td>
87
+ <td><input type="checkbox" name="cool person" /></td>
88
+ </tr>
89
+ <tr>
90
+ <td>Check this if you like ham:</td>
91
+ <td><input type="checkbox" name="likes ham" /></td>
92
+ </tr>
93
+ </table><br />
94
+ <input type="submit" value="Submit" />
95
+ </form>
96
+ <h1>Get Form 2</h1>
97
+ <form name="get_form2" method="get" action="/form post">
98
+ <table>
99
+ <tr>
100
+ <td>First Name</td>
101
+ <td><input type="text" name="first_name" /></td>
102
+ </tr>
103
+ <tr>
104
+ <td>Gender</td>
105
+ <td>
106
+ M: <input type="radio" name="gender" value="male" /><br />
107
+ F: <input type="radio" name="gender" value="female" /><br />
108
+ </td>
109
+ </tr>
110
+ <tr>
111
+ <td>Check this if you are cool:</td>
112
+ <td><input type="checkbox" name="cool person" /></td>
113
+ </tr>
114
+ <tr>
115
+ <td>Check this if you like ham:</td>
116
+ <td><input type="checkbox" name="likes ham" /></td>
117
+ </tr>
118
+ </table><br />
119
+ <input type="submit" value="Submit" />
120
+ </form>
121
+
122
+ <!-- forms with parameters in the action -->
123
+ <h1>Post Form 3</h1>
124
+ <form name="post_form3" method="post" action="/form_post?great day=yes&one=two">
125
+ <table>
126
+ <tr>
127
+ <td>First Name</td>
128
+ <td><input type="text" name="first_name" /></td>
129
+ </tr>
130
+ <tr>
131
+ <td>Gender</td>
132
+ <td>
133
+ M: <input type="radio" name="gender" value="male" /><br />
134
+ F: <input type="radio" name="gender" value="female" /><br />
135
+ </td>
136
+ </tr>
137
+ <tr>
138
+ <td>Check this if you are cool:</td>
139
+ <td><input type="checkbox" name="cool person" /></td>
140
+ </tr>
141
+ <tr>
142
+ <td>Check this if you like ham:</td>
143
+ <td><input type="checkbox" name="likes ham" /></td>
144
+ </tr>
145
+ </table><br />
146
+ <input type="submit" value="Submit" />
147
+ </form>
148
+
149
+ <!-- Post form with multipart/form-data -->
150
+ <h1>Post Form 4 - Multipart</h1>
151
+ <form name="post_form4_multipart" enctype="multipart/form-data" method="post" action="/form_post">
152
+ <table>
153
+ <tr>
154
+ <td>First Name</td>
155
+ <td><input type="text" name="first_name" /></td>
156
+ </tr>
157
+ </table><br />
158
+ <input type="submit" value="Submit" />
159
+ </form>
160
+
161
+ <h1>Get Form 3</h1>
162
+ <form name="get_form3" method="get" action="/form_post?great day=yes&one=two">
163
+ <table>
164
+ <tr>
165
+ <td>First Name</td>
166
+ <td><input type="text" name="first_name" /></td>
167
+ </tr>
168
+ <tr>
169
+ <td>Gender</td>
170
+ <td>
171
+ M: <input type="radio" name="gender" value="male" /><br />
172
+ F: <input type="radio" name="gender" value="female" /><br />
173
+ </td>
174
+ </tr>
175
+ <tr>
176
+ <td>Check this if you are cool:</td>
177
+ <td><input type="checkbox" name="cool person" /></td>
178
+ </tr>
179
+ <tr>
180
+ <td>Check this if you like ham:</td>
181
+ <td><input type="checkbox" name="likes ham" /></td>
182
+ </tr>
183
+ </table><br />
184
+ <input type="submit" value="Submit" />
185
+ </form>
186
+ <a href="/form_test.html">form test</a>
187
+ </body>
188
+ </html>