[SOLVED] How to POST a SOAPAction with synapse? lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- Key-Real · 2023-06-08 20:14 I think to POST a http request the code is like this !?! Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i {$MODE OBJFPC}{$H+}uses httpsend;varf : text;        post : string;        s : string;        http : THTTPSend;begin         assignfile(f, 'add.xml');        reset(f);        post:= '';        repeat              readln(f, s);                post:= post + s + #$0a + #$0d;      until eof(f);        close(f);          //writeln(post);         http:=THTTPSend.Create;         http.Document.Clear;    http.Document.Write(Pointer(post)^, Length(post));    http.MimeType:='text/xml; charset=UTF-8';          if not http.HTTPMethod('POST', 'http://192.168.0.1/upnp/control/WANIPConnection0') then begin                     end;    writeln(http.ResultCode);    writeln(http.ResultString);         http.Free;end.  how to POST a SOAP Action? ---------------------------------------------------------------------- rvk · 2023-06-08 22:12 Small snippet from my code: (this is for getting the UPnP ports forwarded / GetGenericPortMappingEntry) (you should already have read the location for the UPnP service URL and the correct ServiceTag (between the servicetag tags). Note the AddHeader for SOAPAction which you don't have. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i var  S, Found: String;  HTTP: THTTPSend;begin     Location := IP_AND_PATH_OF_ROUTER_UPNP_SERVICE;  ServiceType := SERVICERTPE_BETWEEN_THE_SERVICETYPE_TAGS_IN_SERVICEXML;   S := '';  S := S + '';  S := S + '';  S := S + ' ';  S := S + '  ';  S := S + '   0';  S := S + '  ';  S := S + ' ';  S := S + '';   Response := TStringList.Create;  HTTP := THTTPSend.Create;  try    WriteStrToStream(HTTP.Document, S);    HTTP.MimeType := 'text/xml; charset="utf-8"';    HTTP.Headers.Add('SOAPAction: ' + ServiceType + '#GetGenericPortMappingEntry');    if HTTP.HTTPMethod('POST', Location) then    begin      Response.LoadFromStream(HTTP.Document);    Found := Response.Text;      writeln(found);    end;  finally    Response.Free;    HTTP.Free;  end;end;