Guest User

Untitled

a guest
Jul 21st, 2018
448
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.15 KB | None | 0 0
  1. <form action="http://<addressofsite>/" method="post">
  2. First name:<br>
  3. <input type="text" name="firstname" value="Mickey"><br>
  4. Last name:<br>
  5. <input type="text" name="lastname" value="Mouse"><br><br>
  6. <input type="submit" value="Submit">
  7. </form>
  8.  
  9. procedure TForm1.HTTPServer1CommandGet(AThread: TIdPeerThread;
  10. ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
  11. begin
  12.  
  13. ...
  14.  
  15. if ARequestInfo.Command = 'POST' then
  16. begin
  17. {******* POSTS ***************}
  18. Memo1.Text := ARequestInfo.RawHTTPCommand;
  19. end;
  20. end;
  21.  
  22. Response Headers
  23.  
  24. Connection:close
  25. Content-Type:text/html
  26. Server:Indy/10.0.52
  27.  
  28. Request Headers
  29.  
  30. Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image /webp,*/*;q=0.8
  31. Accept-Encoding:gzip, deflate, br
  32. Accept-Language:en-GB,en-US;q=0.8,en;q=0.6
  33. Authorization:Basic YWRtaW46cGFzcw==
  34. Cache-Control:max-age=0
  35. Connection:keep-alive
  36. Content-Length:31
  37. Content-Type:application/x-www-form-urlencoded
  38. Host:127.0.0.1:8091
  39. Origin:http://127.0.0.1:8091
  40. Referer:http://127.0.0.1:8091/main
  41. Upgrade-Insecure-Requests:1
  42. User-Agent:Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36
  43.  
  44. Form Data
  45.  
  46. firstname:Mickey
  47. lastname:Mouse
  48.  
  49. procedure TForm1.HTTPServer1CommandGet(AThread: TIdPeerThread;
  50. ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
  51. var
  52. FirstName, LastName: string;
  53. begin
  54. ...
  55. if (ARequestInfo.CommandType = hcPOST) and
  56. IsHeaderMediaType(ARequestInfo.ContentType, 'application/x-www-form-urlencoded') then
  57. begin
  58. FirstName := ARequestInfo.Params.Values['firstname'];
  59. LastName := ARequestInfo.Params.Values['lastname'];
  60. ...
  61. end;
  62. end;
  63.  
  64. procedure TForm1.HTTPServer1CommandGet(AThread: TIdPeerThread;
  65. ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
  66. begin
  67. ...
  68. if (ARequestInfo.CommandType = hcPOST) and
  69. HeaderIsMediaType(ARequestInfo.ContentType, 'application/x-www-form-urlencoded') then
  70. begin
  71. TThread.Synchronize(nil,
  72. procedure
  73. begin
  74. Memo1.Text := ARequestInfo.Params.Text;
  75. end
  76. );
  77. ...
  78. end;
  79. end;
Add Comment
Please, Sign In to add comment