test1701 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP POST
  6. HTTP/2
  7. </keywords>
  8. </info>
  9. #
  10. # Server-side
  11. <reply>
  12. <data nocheck="yes">
  13. HTTP/1.1 200 OK
  14. Date: Tue, 09 Nov 2010 14:49:00 GMT
  15. Server: test-server/fake
  16. Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
  17. ETag: "21025-dc7-39462498"
  18. Accept-Ranges: bytes
  19. Content-Length: 6
  20. Connection: close
  21. Content-Type: text/html
  22. Funny-head: yesyes
  23. -foo-
  24. </data>
  25. </reply>
  26. #
  27. # Client-side
  28. <client>
  29. <features>
  30. h2c
  31. </features>
  32. <server>
  33. http
  34. http/2
  35. </server>
  36. <name>
  37. HTTP/2 POST with Upgrade:
  38. </name>
  39. <command>
  40. http://%HOSTIP:%HTTP2PORT/%TESTNUMBER --http2 -d "datatosend"
  41. </command>
  42. </client>
  43. #
  44. # Verify data after the test has been "shot"
  45. <verify>
  46. <strip>
  47. ^X-Forwarded-Proto:.*
  48. ^Via:.*
  49. </strip>
  50. <protocol nonewline="yes">
  51. POST /%TESTNUMBER HTTP/1.1
  52. Host: %HOSTIP:%HTTP2PORT
  53. User-Agent: curl/%VERSION
  54. Accept: */*
  55. Content-Length: 10
  56. Content-Type: application/x-www-form-urlencoded
  57. datatosend
  58. </protocol>
  59. <stdout>
  60. HTTP/1.1 101 Switching Protocols
  61. Connection: Upgrade
  62. Upgrade: h2c
  63. HTTP/2 200
  64. date: Tue, 09 Nov 2010 14:49:00 GMT
  65. last-modified: Tue, 13 Jun 2000 12:10:00 GMT
  66. etag: "21025-dc7-39462498"
  67. accept-ranges: bytes
  68. content-length: 6
  69. content-type: text/html
  70. funny-head: yesyes
  71. via: 1.1 nghttpx
  72. -foo-
  73. </stdout>
  74. <stripfile>
  75. s/^server: nghttpx.*\r?\n//
  76. </stripfile>
  77. </verify>
  78. </testcase>