Category : gzip

I am trying to decode a binary zipped attachment received from a curl request, the attachment is an xml file but sent as binary by the API end point. Here is the full request I received: –_=4883624417507473IBM4883624417507473MOKO Content-Transfer-Encoding: 8bit Content-ID: 30854c92-252a-4cb0-ae65-18ecf0de28d5 Content-Type: application/soap+xml; charset=UTF-8 <?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing"><ns2:Messaging xmlns:ns2="http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" soapenv:mustUnderstand="true" wsu:Id="soapheader-1"> <rest of ..

Read more

Maybe it is intended but i find it weird that "PharData compress" nests the original tar inside of the compressed tar.gz. So you have to open the .tar.gz and you will see the original.tar which you have to open again? Code: $tarPath = $_SERVER[‘DOCUMENT_ROOT’].’api/sample2.tar’; $pharData = new PharData( $tarPath ); $pharData->addFile( $_SERVER[‘DOCUMENT_ROOT’].’api/callback_post.txt’, ‘callback_post.txt’ ); $pharData->compress(Phar::GZ); ..

Read more

I’m using basic cURL requests to fetch webpages in PHP, however these webpages are big in size and I’m limited in bandwidth usage. Is there a way to reduce/optimize cURL data usage, for example using compression. I also heard that Brotli compression is the best, but I’m not sure how to use it. Source: Ask ..

Read more

I’m unable to read gzip encoded response in a Symfony projet. Here is my service : <?php namespace AppService; use SymfonyContractsHttpClientHttpClientInterface; class myApi { private $client; public function __construct(HttpClientInterface $client) { $this->client = $client; } public function getApiContent(){ $headers = [ ‘Accept: application/json’, ‘Accept-Encoding: gzip’, ‘Content-Type: application/json’, ]; $response = $this->client->request(‘GET’, ‘https://www.google.com’, [ ‘headers’ => ..

Read more