Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form action="http://<addressofsite>/" method="post">
- First name:<br>
- <input type="text" name="firstname" value="Mickey"><br>
- Last name:<br>
- <input type="text" name="lastname" value="Mouse"><br><br>
- <input type="submit" value="Submit">
- </form>
- procedure TForm1.HTTPServer1CommandGet(AThread: TIdPeerThread;
- ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
- begin
- ...
- if ARequestInfo.Command = 'POST' then
- begin
- {******* POSTS ***************}
- Memo1.Text := ARequestInfo.RawHTTPCommand;
- end;
- end;
- Response Headers
- Connection:close
- Content-Type:text/html
- Server:Indy/10.0.52
- Request Headers
- Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image /webp,*/*;q=0.8
- Accept-Encoding:gzip, deflate, br
- Accept-Language:en-GB,en-US;q=0.8,en;q=0.6
- Authorization:Basic YWRtaW46cGFzcw==
- Cache-Control:max-age=0
- Connection:keep-alive
- Content-Length:31
- Content-Type:application/x-www-form-urlencoded
- Host:127.0.0.1:8091
- Origin:http://127.0.0.1:8091
- Referer:http://127.0.0.1:8091/main
- Upgrade-Insecure-Requests:1
- 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
- Form Data
- firstname:Mickey
- lastname:Mouse
- procedure TForm1.HTTPServer1CommandGet(AThread: TIdPeerThread;
- ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
- var
- FirstName, LastName: string;
- begin
- ...
- if (ARequestInfo.CommandType = hcPOST) and
- IsHeaderMediaType(ARequestInfo.ContentType, 'application/x-www-form-urlencoded') then
- begin
- FirstName := ARequestInfo.Params.Values['firstname'];
- LastName := ARequestInfo.Params.Values['lastname'];
- ...
- end;
- end;
- procedure TForm1.HTTPServer1CommandGet(AThread: TIdPeerThread;
- ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
- begin
- ...
- if (ARequestInfo.CommandType = hcPOST) and
- HeaderIsMediaType(ARequestInfo.ContentType, 'application/x-www-form-urlencoded') then
- begin
- TThread.Synchronize(nil,
- procedure
- begin
- Memo1.Text := ARequestInfo.Params.Text;
- end
- );
- ...
- end;
- end;
Add Comment
Please, Sign In to add comment