2
0

test386 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP POST
  6. --json
  7. </keywords>
  8. </info>
  9. #
  10. # Server-side
  11. <reply>
  12. <data>
  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. <data2>
  26. HTTP/1.1 200 OK
  27. Date: Tue, 09 Nov 2010 14:49:00 GMT
  28. Server: test-server/fake
  29. Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
  30. ETag: "21025-dc7-39462498"
  31. Accept-Ranges: bytes
  32. Content-Length: 6
  33. Connection: close
  34. Content-Type: text/html
  35. Funny-head: yesyes
  36. hello
  37. </data2>
  38. </reply>
  39. #
  40. # Client-side
  41. <client>
  42. <server>
  43. http
  44. </server>
  45. <name>
  46. HTTP with --json + --next
  47. </name>
  48. <command>
  49. --json '{ "drink": "coffe" }' http://%HOSTIP:%HTTPPORT/%TESTNUMBER --next http://%HOSTIP:%HTTPPORT/%TESTNUMBER0002
  50. </command>
  51. </client>
  52. #
  53. # Verify data after the test has been "shot"
  54. <verify>
  55. <protocol>
  56. POST /%TESTNUMBER HTTP/1.1
  57. Host: %HOSTIP:%HTTPPORT
  58. User-Agent: curl/%VERSION
  59. Content-Type: application/json
  60. Accept: application/json
  61. Content-Length: 20
  62. { "drink": "coffe" }GET /%TESTNUMBER0002 HTTP/1.1
  63. Host: %HOSTIP:%HTTPPORT
  64. User-Agent: curl/%VERSION
  65. Accept: */*
  66. </protocol>
  67. </verify>
  68. </testcase>