Skip to content

Commit a99362e

Browse files
Williams IsaacWilliams Isaac
Williams Isaac
authored and
Williams Isaac
committed
Removed Redundant Files and Updated Http Client
1 parent 5b5d299 commit a99362e

File tree

3 files changed

+22
-33
lines changed

3 files changed

+22
-33
lines changed

'Williams']

-2
This file was deleted.

data

-1
This file was deleted.

src/AppBundle/Commands/HttpRequestHandler.php

+22-30
Original file line numberDiff line numberDiff line change
@@ -27,39 +27,31 @@ protected function execute(InputInterface $input, OutputInterface $output)
2727
{
2828
// outputs multiple lines to the console (adding "\n" at the end of each line)
2929
$http = HttpClient::getInstance();
30+
$output->writeln([
31+
"<comment>Executing Command -> app:request-url {$input->getArgument('requesturl')}</comment>",
32+
'**************************************************',
33+
]);
3034

31-
$data = [];
32-
$param = $input->getArgument('params');
33-
$result = explode(':', $param);
34-
foreach ($result as $key) {
35+
$execute = $http->makeRequest($input->getArgument('requesturl'),$input->getArgument('method'),$input->getArgument('params'));
3536

37+
if ($execute->status) {
38+
$output->writeln([
39+
"<bg=green;options=bold>{$execute->message}</>",
40+
'**************************************************',
41+
]);
42+
$result = ['statusCode' => $execute->data->code, 'body' => $execute->data->body];
43+
print_r($result);
44+
$output->writeln([
45+
"<bg=blue;options=bold>Raw Body: {$execute->data}</>",
46+
'**************************************************',
47+
]);
48+
}
49+
else {
50+
$output->writeln([
51+
"<bg=red;options=bold>{$execute->message}</>",
52+
'**************************************************',
53+
]);
3654
}
37-
print_r($data);
38-
// $output->writeln([
39-
// "<comment>Executing Command -> app:request-url {$input->getArgument('requesturl')}</comment>",
40-
// '**************************************************',
41-
// ]);
42-
//
43-
// $execute = $http->makeRequest($input->getArgument('requesturl'),$input->getArgument('method'),$input->getArgument('params'));
44-
//
45-
// if ($execute->status) {
46-
// $output->writeln([
47-
// "<bg=green;options=bold>{$execute->message}</>",
48-
// '**************************************************',
49-
// ]);
50-
// $result = ['statusCode' => $execute->data->code, 'body' => $execute->data->body];
51-
// print_r($result);
52-
// $output->writeln([
53-
// "<bg=blue;options=bold>Raw Body: {$execute->data}</>",
54-
// '**************************************************',
55-
// ]);
56-
// }
57-
// else {
58-
// $output->writeln([
59-
// "<bg=red;options=bold>{$execute->message}</>",
60-
// '**************************************************',
61-
// ]);
62-
// }
6355
// $output->writeln([]), $input->getArgument('method')]);
6456

6557

0 commit comments

Comments
 (0)