HTTP Server socket lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- berghem · 2021-02-16 20:18 Hi All I need to write an application that receive a POST with simple Json {"variable1":"Value","Variable2":"Value",....} I'm using synapse library (but I can change and use another library) but i didn't see any example.... ---------------------------------------------------------------------- zamronypj · 2021-02-16 23:59 I do not know about synapse, but if  you use fpweb, TRequest has OnUnknownEncoding event which will be called when request is handling POST or PUT request but with unknown content type. Currently fpweb TRequest handles multipart/form-data and application/x-www-form-urlencoded only. So POST with application/json content-type is unknown content type. However to be able to set OnUnknownEncoding event you need to set it before request body is read and parsed. Best place to set it I guess would be to override TFPCustomHttpServer.initRequest() method. This method is called after TRequest instance is created but before reading data from socket. ---------------------------------------------------------------------- berghem · 2021-02-18 20:31 Thanks, I resolved with this Library fpweb, it's very simple with 1 code row tks ---------------------------------------------------------------------- Remy Lebeau · 2021-02-19 16:19 Quote from: berghem on February 16, 2021, 09:18:25 pmI need to write an application that receive a POST with simple Json {"variable1":"Value","Variable2":"Value",....} I'm using synapse library (but I can change and use another library) but i didn't see any example.... Indy has a TIdHTTPServer component.  In its OnCommandGet event (which also handles POSTs), you can access the JSON data via the provided ARequestInfo parameter, in its PostStream property. ---------------------------------------------------------------------- BSaidus · 2021-08-08 21:12 Quote from: Remy Lebeau on February 19, 2021, 05:19:21 pmQuote from: berghem on February 16, 2021, 09:18:25 pmI need to write an application that receive a POST with simple Json {"variable1":"Value","Variable2":"Value",....} I'm using synapse library (but I can change and use another library) but i didn't see any example.... Indy has a TIdHTTPServer component.  In its OnCommandGet event (which also handles POSTs), you can access the JSON data via the provided ARequestInfo[/font/ parameter, in its PostStream property. Yep, Thanks