Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.
In this example, I needed to get a currency exchange rate for two currencies, in order to use them in an expense report. I am using MS Access and macros.
I've found a site where I can easily send the currency parameters I needed and the response was returned as a JSON structure, which is easy to manipulate.
However, when I've checked the request (in WireShark), in order to use it in a macro function, I saw that the result was gibberish:
? ?V*?-JNU?Rr R?*I,JO-r=}??\?lpi.P?. ?Y?[?%??? 1P???????????B<l?T- ??Vu
I then started to look for an idea of what might be the "problem". I needed the response data in plain text, much like a browser knows to show you when it performs the same request.
I saw a post about this here - MS Access VBA How To Decompress a Gzip Response From a HTTP Request and it got me thinking about the compression, since an "Accept-Encoding" header in the request has "gzip" as its value.
I looked for the possible values for the Accept-Encoding header and I leaned that in order to get the response as plain text, I needed to use deflate, as in the example below:
Accept-Encoding: identity, deflate
Accept-Encoding: identity, gzip;q=0
This tells the server to not use compress the response with gzip and instead to send me the plain text (or uncompressed, i.e. deflate) version of the response.
The reason the response is compressed is to be more efficient with bandwidth. With larger datasets it may be necessary to deflate the response on the client if the uncompressed version is far larger than the compressed version.
Now, after modifying this header, I received the response I needed, which made it far easier to parse in my macro:
It solved my problem and I hope it'll help all the others.
Have a great day,
|Update and Secure Legacy PHP Scripts wih filter_input_array and PDO Prepared Statements||1,694|
|AJAX form submission with customized server field validation||1,500|
|Unlock VBA Project Password Excel 2010 & 2013 – Solutions to Recover||2,226|
|How to close an Access report by pressing Escape (Esc) key||397|