I tried running j wget in a command window on windows 10:
C:\Program Files\j64-807\tools\ftp>.\wget
"http://api.stackexchange.com/2.2/answers/264298?order=desc&sort=activity&site=meta&filter=!.UDo6l2ikDi7iGlf"
-OC:\Users\me\Downloads\foo1.xxx
and the file created was unzipped:
{"items":[{"last_activity_date":1440639019,"answer_id":264298,"body_markdown":"Yes,
the field `body_markdown` returns the post body *in MarkDown*.\r\n\r\n[Live
Example](http://api.stackexchange.com/docs/answers-by-ids#order=desc&sort=activity&ids=264298&filter=...
I tried running j wget in a command window using the options in gethttp:
C:\Program Files\j64-807\tools\ftp>.\wget -O - -q
"http://api.stackexchange.com/2.2/answers/264298?order=desc&sort=activity&site=meta&filter=!.UDo6l2ikDi7iGlf"
{non-text}
So it looks like j wget will uncompress when writing to a file rather than
stdout.
On 3/2/2019 10:52, bill lam wrote:
You can use gunzip to decompress the data.
busybox.exe bundled in j807 should have this function.
Sat, 02 Mar 2019, bill lam написал(а):
Oh, I tried, stackexchange always responsed with gzip data even
wget had not asked. You need to add an extra option in wget
--compression=gzip
try use --compressed if it is curl.
I think you are using windows because your api string won't work
on linux, shell will expand special character in it unless
quoted.
the wget.exe bundled in J are old and does not support the above
mentioned option, not sure about the curl.exe in the addon.
Sat, 02 Mar 2019, bill lam написал(а):
If you are using a recent enough version of wget, it should
automatically decompress data received.
Sat, 02 Mar 2019, Nimp O написал(а):
Hello everyone,
For educational purposes I'm trying to read a JSON response from the
StackOverflow API in J.
My current session is:
load'web/gethttp'
load'pjson'
api=:'http://api.stackexchange.com/2.2/answers/264298?order=desc&sort=activity&site=meta&filter=!.UDo6l2ikDi7iGlf'
gethttp api
�U��J1┌�_%F┌
��┼┬��[�P�����Ŧ��
�M��ٶK黛]O�����s���&Y,� ...
The problem is that apparently the response is gzipped. Does anyone know how
can I accomplish the decompression of this binary response inside J?
I tried using the arc/zip and zlib addons with no success.
Thanks.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
--
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
gpg --keyserver subkeys.pgp.net --armor --export 4434BAB3
--
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
gpg --keyserver subkeys.pgp.net --armor --export 4434BAB3
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm