Skip to content

Instantly share code, notes, and snippets.

@suryanto
Created August 4, 2020 05:05
Show Gist options
  • Save suryanto/138480b39482505ef34fb4fd9986d2bc to your computer and use it in GitHub Desktop.
Save suryanto/138480b39482505ef34fb4fd9986d2bc to your computer and use it in GitHub Desktop.
<?php
use Drupal\Component\Serialization\Json;
/** @var \GuzzleHttp\Client $client */
$client = \Drupal::service('http_client_factory')->fromOptions([
'base_uri' => 'https://pweb.permata.xituz.com/',
]);
$response = $client->get('sites/default/files/feeds/dummy_mf.json');
$json_data = Json::decode($response->getBody());
$json_data = $json_data['MFProductInqRs']['MFProductInqList'];
foreach ($json_data as $data) {
print_r($data);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment