Ignore:
Timestamp:
Jun 19, 2012, 10:38:51 PM (12 years ago)
Author:
chronos
Message:
  • Added: Test of POST data handling for HTTPServerTCP.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Network/CoolWeb/WebServer/UHTTPServerTCP.pas

    r376 r377  
    8888      Request.Cookies.Parse(Request.Headers.Values['Cookie']);
    8989
     90    if (Request.Method = 'POST') and (Request.Headers.SearchKey('Content-Type') <> -1) then begin
     91      if (Request.Headers.Values['Content-Type'] = 'application/x-www-form-urlencoded') and
     92        (Request.Headers.SearchKey('Content-Length') <> -1) then begin
     93          SetLength(Line, StrToInt(Request.Headers.Values['Content-Length']));
     94          RecvBuffer(Pointer(Line[1]), Length(Line));
     95          Request.Post.Parse(Line);
     96      end;
     97    end;
     98
    9099    // Load session variables
    91100    if Assigned(SessionStorage) then
Note: See TracChangeset for help on using the changeset viewer.