How to send gzipped json response from Google Cloud Functions?

Look at the App Engine FAQ, specifically the answer to the question "How do I serve compressed content?":

....To force gzipped content to be served, clients may supply 'gzip' as the value of both the Accept-Encoding and User-Agent request headers. Content will never be gzipped if no Accept-Encoding header is present...

Also, in this group post there's an example of how to send a request with Cloud Functions using the combination of Accept-Encoding, User-Agent:

curl -v "https://us-central1-<project>.cloudfunctions.net/test" -H "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36" -H "Accept-Encoding: gzip"