Using
Read or
ReadEx method on the Sender object will give you the content body (not the header) currently stored in that connections receiving buffer and clear the buffer immediately. This gives you the flexibility to use the Read or ReadEx method in every event as data arrives and store "chunks" in some specific place (for example, in a file or in the
Request.Params object for parsing the form POST data) or ... to wait for the complete request to arrive (Request.Complete), then use the Read or ReadEx method once to get the whole content body in a single variable and use it for parsing that content with some specific library (for example, when receiving direct JSON requests from JavaScript).
Your questions are very basic, which makes me wonder if you even finished the very first few Quick Start lessons. If you haven't, please finish at least these Server-side lessons:
Server Lesson 1: Write your first RTC HTTP ServerServer Lesson 2: Sending dynamically generated contentServer Lesson 2b: Using Query parametersServer Lesson 3: Sending small files from a folderServer Lesson 4: Sending large files outWhen you are finished with the lessons I've listed above, take a look in the "QuickStart" folder at the "BrowserUpload" and the "SimpleJSONServer" examples Projects. One is about writing a Server to host a Web site receiving Form POST data from a Web Browser, the other one is about responding to JSON requests (as said above).
For more Quick Start lessons,
check - HERE.
By the way ... GET requests do not have a content body. Anything you enter into the Address field of any Web Browser will be sent as a GET request to the Server, which is why using the Read or ReadEx method will return an empty result. Request headers (everything inside the HTTP request line and all the header variables sent before the content body) are stored in the TRtcDataServer(Sender)
.Request object, which you have full access to already from the "OnCheckRequest" event on the TRtcDataReceived component.
Best Regards,
Danijel Tkalcec