Skip to content

Commit e079461

Browse files
committed
update readme
1 parent 5777e94 commit e079461

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ composer require php-comp/http-client
2121
### 创建客户端实例
2222

2323
```php
24-
2524
// use factory
2625
$client = Client::factory([
2726
'driver' => 'curl', // stream, fsock, file, co, co2

src/Curl/CurlClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use PhpComp\Http\Client\AbstractClient;
1212
use PhpComp\Http\Client\ClientUtil;
1313
use PhpComp\Http\Client\Error\ClientException;
14-
use PhpComp\Http\Client\Traits\RawResponseParserTrait;
14+
use PhpComp\Http\Client\Traits\ParseRawResponseTrait;
1515

1616
/**
1717
* Class Curl
@@ -36,7 +36,7 @@
3636
*/
3737
class CurlClient extends AbstractClient implements CurlClientInterface
3838
{
39-
use RawResponseParserTrait;
39+
use ParseRawResponseTrait;
4040

4141
// ssl auth type
4242
const SSL_TYPE_CERT = 'cert';

src/FOpenClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
namespace PhpComp\Http\Client;
1010

1111
use PhpComp\Http\Client\Error\ClientException;
12-
use PhpComp\Http\Client\Traits\RawResponseParserTrait;
12+
use PhpComp\Http\Client\Traits\ParseRawResponseTrait;
1313
use PhpComp\Http\Client\Traits\StreamContextBuildTrait;
1414

1515
/**
@@ -18,7 +18,7 @@
1818
*/
1919
class FOpenClient extends AbstractClient
2020
{
21-
use RawResponseParserTrait, StreamContextBuildTrait;
21+
use ParseRawResponseTrait, StreamContextBuildTrait;
2222

2323
/**
2424
* The network resource handle, it's created by:

src/FSockClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
use PhpComp\Http\Client\Error\ClientException;
1212
use PhpComp\Http\Client\Error\RequestException;
1313
use PhpComp\Http\Client\Traits\BuildRawHttpRequestTrait;
14-
use PhpComp\Http\Client\Traits\RawResponseParserTrait;
14+
use PhpComp\Http\Client\Traits\ParseRawResponseTrait;
1515

1616
/**
1717
* Class FSockClient - powered by func fsockopen()
1818
* @package PhpComp\Http\Client
1919
*/
2020
class FSockClient extends AbstractClient
2121
{
22-
use BuildRawHttpRequestTrait, RawResponseParserTrait;
22+
use BuildRawHttpRequestTrait, ParseRawResponseTrait;
2323

2424
/**
2525
* @see https://secure.php.net/manual/zh/function.stream-get-meta-data.php

src/FileClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
namespace PhpComp\Http\Client;
1010

1111
use PhpComp\Http\Client\Error\ClientException;
12-
use PhpComp\Http\Client\Traits\RawResponseParserTrait;
12+
use PhpComp\Http\Client\Traits\ParseRawResponseTrait;
1313
use PhpComp\Http\Client\Traits\StreamContextBuildTrait;
1414

1515
/**
@@ -18,7 +18,7 @@
1818
*/
1919
class FileClient extends AbstractClient
2020
{
21-
use StreamContextBuildTrait, RawResponseParserTrait;
21+
use StreamContextBuildTrait, ParseRawResponseTrait;
2222

2323
/**
2424
* @return bool

src/StreamClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
use PhpComp\Http\Client\Error\ClientException;
1212
use PhpComp\Http\Client\Error\RequestException;
1313
use PhpComp\Http\Client\Traits\BuildRawHttpRequestTrait;
14-
use PhpComp\Http\Client\Traits\RawResponseParserTrait;
14+
use PhpComp\Http\Client\Traits\ParseRawResponseTrait;
1515

1616
/**
1717
* Class StreamClient
1818
* @package PhpComp\Http\Client
1919
*/
2020
class StreamClient extends AbstractClient
2121
{
22-
use BuildRawHttpRequestTrait, RawResponseParserTrait;
22+
use BuildRawHttpRequestTrait, ParseRawResponseTrait;
2323

2424
/**
2525
* stream context. it's create by stream_context_create()
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
namespace PhpComp\Http\Client\Traits;
1010

1111
/**
12-
* Trait RawResponseParserTrait
12+
* Trait ParseRawResponseTrait
1313
* @package PhpComp\Http\Client\Traits
1414
*/
15-
trait RawResponseParserTrait
15+
trait ParseRawResponseTrait
1616
{
1717
/**
1818
* The curl exec response data string. contains headers and body
@@ -89,6 +89,7 @@ protected function parseResponseHeaders(array &$headers)
8989
// \preg_match('#(.*?)\:\s(.*)#', $header, $matches);
9090
// $this->responseHeaders[$matches[1]] = $matches[2];
9191
list($name, $value) = \explode(': ', $header);
92+
$name = \ucwords($name);
9293
$this->responseHeaders[$name] = $value;
9394
}
9495
}

0 commit comments

Comments
 (0)