httpreq-help.pd 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. #N canvas 525 51 712 894 10;
  2. #X obj 119 146 httpreq;
  3. #X obj 44 56 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
  4. -1;
  5. #X msg 84 94 GET http://132.205.142.12/index.php;
  6. #X obj 136 309 unpack 0 0 0 0;
  7. #X floatatom 136 332 3 0 0 0 - - -;
  8. #X floatatom 163 332 3 0 0 0 - - -;
  9. #X floatatom 190 332 3 0 0 0 - - -;
  10. #X floatatom 217 332 3 0 0 0 - - -;
  11. #X text 81 350 from;
  12. #X obj 119 257 tcpclient;
  13. #X obj 153 283 tgl 15 0 empty empty connected 18 7 0 8 -24198 -13381
  14. -1 0 1;
  15. #X text 190 256 tcpclient opens a tcp socket to send and receive bytes
  16. on;
  17. #X floatatom 270 342 9 0 0 0 - - -;
  18. #X floatatom 313 320 9 0 0 0 - - -;
  19. #X text 382 319 Size of the send buffer;
  20. #X obj 270 274 route sent buf blocked;
  21. #X text 340 341 Number of bytes sent;
  22. #X obj 356 298 print sender_blocked!;
  23. #X msg 85 206 connect 132.205.142.12 80;
  24. #X obj 119 450 httpreceive;
  25. #X floatatom 182 483 5 0 0 0 - - -;
  26. #X symbolatom 150 642 10 0 0 0 - - -;
  27. #X obj 150 620 prepend set;
  28. #X symbolatom 216 600 50 0 0 0 - - -;
  29. #X obj 216 578 prepend set;
  30. #X obj 150 526 route reason Date Content-Length Content-Type;
  31. #X symbolatom 350 568 50 0 0 0 - - -;
  32. #X obj 350 546 prepend set;
  33. #X floatatom 283 558 5 0 0 0 - - -;
  34. #X msg 64 74 GET http://132.205.142.12/nothing;
  35. #X msg 44 165 dump \$1;
  36. #X obj 44 139 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
  37. 1;
  38. #X obj 37 328 tgl 15 0 empty empty empty 17 7 0 10 -4034 -257985 -1
  39. 0 1;
  40. #X msg 37 351 verbosity \$1;
  41. #X obj 457 543 print more_status;
  42. #X obj 76 392 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
  43. -1;
  44. #X text 515 726 Author: Martin Peach;
  45. #X text 515 743 Date: 2011/01/13;
  46. #X text 224 481 The right outlet is the status code.;
  47. #X text 166 693 The left outlet is the message body as a list of bytes
  48. ;
  49. #X text 154 505 The middle outlet is the status header as name/value
  50. pairs;
  51. #X obj 119 693 spigot;
  52. #X obj 119 723 print message_body;
  53. #X obj 152 671 tgl 15 0 empty empty printing_long_messages_can_hang_Pd
  54. 17 7 0 10 -4034 -257985 -1 0 1;
  55. #X text 175 147 [httpreq] sends an HTTP/1.1 request as a list of bytes
  56. (actually float atoms) \, suitable for [tcpclient];
  57. #X text 195 444 [htpreceive] expects an HTTP/1.1 response as one or
  58. more lists of bytes.;
  59. #X text 187 557 message length:;
  60. #X obj 27 14 tgl 15 0 empty empty empty 17 7 0 10 -4034 -257985 -1
  61. 1 1;
  62. #X msg 27 37 verbosity \$1;
  63. #X msg 105 115 HEAD http://132.205.142.12/index.php;
  64. #X text 175 185 So far only GET and HEAD requests are supported;
  65. #X text 274 73 should return 404 not found;
  66. #X text 306 93 should return a web page;
  67. #X text 332 114 should return only the metainformation;
  68. #X connect 0 0 9 0;
  69. #X connect 1 0 0 0;
  70. #X connect 2 0 0 0;
  71. #X connect 3 0 4 0;
  72. #X connect 3 1 5 0;
  73. #X connect 3 2 6 0;
  74. #X connect 3 3 7 0;
  75. #X connect 9 0 19 0;
  76. #X connect 9 1 3 0;
  77. #X connect 9 2 10 0;
  78. #X connect 9 3 15 0;
  79. #X connect 15 0 12 0;
  80. #X connect 15 1 13 0;
  81. #X connect 15 2 17 0;
  82. #X connect 18 0 9 0;
  83. #X connect 19 0 41 0;
  84. #X connect 19 1 25 0;
  85. #X connect 19 2 20 0;
  86. #X connect 22 0 21 0;
  87. #X connect 24 0 23 0;
  88. #X connect 25 0 22 0;
  89. #X connect 25 1 24 0;
  90. #X connect 25 2 28 0;
  91. #X connect 25 3 27 0;
  92. #X connect 25 4 34 0;
  93. #X connect 27 0 26 0;
  94. #X connect 29 0 0 0;
  95. #X connect 30 0 9 0;
  96. #X connect 31 0 30 0;
  97. #X connect 32 0 33 0;
  98. #X connect 33 0 19 0;
  99. #X connect 35 0 19 0;
  100. #X connect 41 0 42 0;
  101. #X connect 43 0 41 1;
  102. #X connect 47 0 48 0;
  103. #X connect 48 0 0 0;
  104. #X connect 49 0 0 0;