Skip to content

Commit dd7e17a

Browse files
author
Shuo
authored
Merge pull request #2 from openset/develop
A: ext-json
2 parents aeda2a9 + 4d90512 commit dd7e17a

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"minimum-stability": "stable",
1717
"require": {
1818
"php": ">=5.6",
19+
"ext-json": "*",
1920
"guzzlehttp/guzzle": "^6.3"
2021
},
2122
"require-dev": {

src/HttpClient.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
/**
99
* Class HttpClient
10+
*
1011
* @package Openset
1112
*/
1213
class HttpClient
@@ -25,6 +26,7 @@ class HttpClient
2526

2627
/**
2728
* 配置
29+
*
2830
* @param array $config
2931
*/
3032
public static function setConfig(array $config)
@@ -34,6 +36,7 @@ public static function setConfig(array $config)
3436

3537
/**
3638
* 客户端
39+
*
3740
* @return Client
3841
*/
3942
public static function getClient()
@@ -47,6 +50,7 @@ public static function getClient()
4750

4851
/**
4952
* 请求
53+
*
5054
* @param $method
5155
* @param string $uri
5256
* @param array $options
@@ -65,6 +69,7 @@ public static function request($method, $uri = '', array $options = [])
6569

6670
/**
6771
* get请求
72+
*
6873
* @param $uri
6974
* @param array $options
7075
* @return bool|\Psr\Http\Message\StreamInterface
@@ -77,6 +82,7 @@ public static function get($uri, array $options = [])
7782

7883
/**
7984
* post请求
85+
*
8086
* @param $url
8187
* @param array $options
8288
* @return bool|\Psr\Http\Message\StreamInterface
@@ -91,6 +97,7 @@ public static function post($url, $options = [])
9197

9298
/**
9399
* post json 数据
100+
*
94101
* @param $url
95102
* @param string $options
96103
* @param array $queries
@@ -113,6 +120,7 @@ public static function json($url, $options = '{}', array $queries = [], $encodeO
113120

114121
/**
115122
* 文件上传
123+
*
116124
* @param $url
117125
* @param array $files
118126
* @param array $form
@@ -138,9 +146,9 @@ public static function upload($url, array $files = [], array $form = [], array $
138146
return self::request('POST', $url, ['query' => $queries, 'multipart' => $multipart]);
139147
}
140148

141-
142149
/**
143150
* 解析json字符串
151+
*
144152
* @param $method
145153
* @param array $args
146154
* @return bool|mixed

0 commit comments

Comments
 (0)