N
N
Nikita2016-03-26 21:14:33
ASP.NET
Nikita, 2016-03-26 21:14:33

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

2 answer(s)
V
Vadim Matkarimov, 2016-03-27
@interlocked

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.

V
Vitaly Pukhov, 2016-03-27
@Neuroware

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 question

Ask a Question

731 491 924 answers to any question