[SOLVED] Verbs HTTP lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- Almir Lima · 2019-05-25 16:25 Hy everyone, I want send others verbs in HTTP like PUT PATCH DELETE with Synapse, but i cannot find. ---------------------------------------------------------------------- Almir Lima · 2019-05-26 01:59 The goal is do a API and use all RESTFUL verbs. GET, POST, PUT, PATCH, DELETE, OPTIONS. I solved this creating a clone function of the Synapse HttpSend with a little modify: "A option for alter the Verbs to send a request." I tested  in NodeJS, and everything worked perfect. This the code. 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 function Http_Send(const Verb, URL: string; const Data: TStream  ): Boolean;var  HTTP: THTTPSend;begin  HTTP := THTTPSend.Create;  try    HTTP.Document.CopyFrom(Data, 0);    HTTP.MimeType := 'Application/octet-stream';    Result := HTTP.HTTPMethod( Verb, URL);    Data.Size := 0;    if Result then    begin      Data.Seek(0, soFromBeginning);      Data.CopyFrom(HTTP.Document, 0);    end;  finally    HTTP.Free;  end;end; ---------------------------------------------------------------------- lucamar · 2019-05-26 07:27 A friendly reminder: When talking about networking you should have a care how you use the terminology, lest confussion arises. Those "verbs" you talk about have little to do with RESTful APIs, but with WEBDAV. See here: WebDAV Ressources. Also, if you want to build a generic solution you should add a functions to send multipart- in addition to URL-encoded  requests. Most Web APIs I know of expect them, since they deal with relatively big objects (documents, images, etc.) that can't be encoded in the URL. For example, here's how we defined some net-helpers when we built our (Delphi) Flickr API objects: 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 { Calls to Web Sites' APIs like p.e. Flickr's }{HTTP service request--url-encoded params Make a request using HTTP Method, passing parameters @code(Params) in url-encoded form. }function WebMethodCall(const BaseURL: String; Params: TStrings;                     Method: TReqMethod = rqPost): String; overload;{HTTP service request--w/out params Make a request using HTTP Method passing no parameters (unless already encoded by the user in @code(BaseURL).}function WebMethodCall(const BaseURL: String;                     Method: TReqMethod = rqPost): String; overload;{HTTP service request--Multipart/Form-Data Make a request using HTTP POST and passing parameters as a Multipart/Form-Data stream. Used, generally, to upload a file to a server. }function WebMethodCall(const BaseURL: String;                       FormData: TIdMultiPartFormDataStream): String; overload;