Answer the question
In order to leave comments, you need to log in
How to organize sending / receiving data?
There is a REST service ASP.NET WEB API2 (server part) that works with MSSQL database. It is necessary to send/receive pieces of program code (code snippets) via HTTP requests (contentType: "application/json").
Question: How can you send the program code, save it to the database, process it on the server and, accordingly, then get it back to the client part (also .NET) so that the code does not lose its formatting?
Answer the question
In order to leave comments, you need to log in
It is best to use special data serialization/deserialization formats. Take a closer look at MessagePack , it was just created as a replacement for the JSON format, only faster, there is support for all popular programming languages.
You can also use Protocol Buffers (Protobuf) from Google, but you will have to spend time mastering it, at least a week, there are nuances.
Pack all text in which you want to preserve the formatting in Base64 and then send it, similarly unpack it back after receiving
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question