Reputation: 99
I have a restful application, where I need to send text as response to REST client. Now the problem is that sometimes text could be huge nearly 100000 characters.
Can I send large data as normal, plain text?
How to send it through the network to my REST client?
Upvotes: 2
Views: 3413
Reputation: 44960
You should use HTTP compression by using Accept-Encoding
request header and Content-Encoding
response header:
GET /your-url HTTP/1.1
Host: www.example.com
Accept-Encoding: gzip, deflate
This will make the compression transparent for most REST API clients. GZIP should be handled out of the box by most client libraries plus it can be disabled by not setting Accept-Encoding
header.
Upvotes: 2