Use http1.1 from curl not to get compressed output #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Compressed data is output with recent curl. This problem happens because of
the following logic.
prohibited by Accept-Encoding header(*1).
*1) When using http1.1, twitter API doesn't compress the output by default
For more information about this twitter API's problem, please see
the following URL.
https://twittercommunity.com/t/twitter-api-doesnt-look-header-accept-encoding-identity/56571
===============================================================================
$ ./tweet.sh showme | file -
Probably this problem happens with any other subcommands.
===============================================================================
$ ./tweet.sh showme | file -
/dev/stdin: gzip compressed data, from FAT filesystem (MS-DOS, OS/2, NT)
$
===============================================================================
$ ./tweet.sh showme | file -
/dev/stdin: ASCII text, with very long lines, with no line terminators
$
curl 7.50.1 (x86_64-pc-linux-gnu) libcurl/7.50.1 GnuTLS/3.5.7 zlib/1.2.8 libidn/1.33 libssh2/1.7.0 nghttp2/1.17.0 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets
I confirmed this problem didn't happen with curl 7.35.0. This version uses
http1.1 by default.