You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34-23
Original file line number
Diff line number
Diff line change
@@ -47,16 +47,20 @@ use SparkPost\SparkPost;
47
47
use GuzzleHttp\Client;
48
48
use Http\Adapter\Guzzle6\Client as GuzzleAdapter;
49
49
50
-
$httpAdapter = new GuzzleAdapter(new Client());
51
-
$sparky = new SparkPost($httpAdapter, ['key'=>'YOUR_API_KEY']);
50
+
$httpClient = new GuzzleAdapter(new Client());
51
+
$sparky = new SparkPost($httpClient, ['key'=>'YOUR_API_KEY']);
52
52
?>
53
53
```
54
54
55
55
## Initialization
56
-
#### new Sparkpost(httpAdapter, options)
57
-
*`httpAdapter`
56
+
#### new Sparkpost(httpClient, options)
57
+
*`httpClient`
58
58
* Required: Yes
59
59
* HTTP client or adapter supported by HTTPlug
60
+
*`options`
61
+
* Required: Yes
62
+
* Type: `String` or `Array`
63
+
* A valid Sparkpost API key or an array of options
60
64
*`options.key`
61
65
* Required: Yes
62
66
* Type: `String`
@@ -73,10 +77,6 @@ $sparky = new SparkPost($httpAdapter, ['key'=>'YOUR_API_KEY']);
73
77
* Required: No
74
78
* Type: `Number`
75
79
* Default: 443
76
-
*`options.strictSSL`
77
-
* Required: No
78
-
* Type: `Boolean`
79
-
* Default: `true`
80
80
*`options.version`
81
81
* Required: No
82
82
* Type: `String`
@@ -86,8 +86,9 @@ $sparky = new SparkPost($httpAdapter, ['key'=>'YOUR_API_KEY']);
86
86
* Type: `Number`
87
87
* Default: `10`
88
88
89
+
89
90
## Methods
90
-
### request(method, uri [, payload])
91
+
### request(method, uri [, payload[, headers]])
91
92
*`method`
92
93
* Required: Yes
93
94
* Type: `String`
@@ -100,12 +101,23 @@ $sparky = new SparkPost($httpAdapter, ['key'=>'YOUR_API_KEY']);
100
101
* Required: No
101
102
* Type: `Array`
102
103
* If the method is `GET` the values are encoded into the URL. Otherwise, if the method is `POST`, `PUT`, or `DELETE` the payload is used for the request body.
104
+
*`headers`
105
+
* Required: No
106
+
* Type: `Array`
107
+
* If the method is `GET` the values are encoded into the URL. Otherwise, if the method is `POST`, `PUT`, or `DELETE` the payload is used for the request body.
103
108
104
-
### setHttpAdapter(httpAdapter)
105
-
*`httpAdapter`
109
+
### setHttpClient(httpClient)
110
+
*`httpClient`
106
111
* Required: Yes
107
112
* HTTP client or adapter supported by HTTPlug
108
113
114
+
### setOptions(options)
115
+
*`options`
116
+
* Required: Yes
117
+
* Type: `Array`
118
+
* See initialization
119
+
120
+
109
121
## Endpoints
110
122
### transmissions
111
123
***get([transmissionID][, payload])**
@@ -123,7 +135,6 @@ $sparky = new SparkPost($httpAdapter, ['key'=>'YOUR_API_KEY']);
123
135
* Recipients to descreetly recieve a carbon copy of the transmission
124
136
***delete(transmissionID)**
125
137
*`transmissionID` - see `uri` request options
126
-
*`payload` - see request options
127
138
128
139
## Examples
129
140
@@ -134,8 +145,8 @@ use SparkPost\SparkPost;
134
145
use GuzzleHttp\Client;
135
146
use Http\Adapter\Guzzle6\Client as GuzzleAdapter;
136
147
137
-
$httpAdapter = new GuzzleAdapter(new Client());
138
-
$sparky = new SparkPost($httpAdapter, ['key'=>'YOUR_API_KEY']);
148
+
$httpClient = new GuzzleAdapter(new Client());
149
+
$sparky = new SparkPost($httpClient, ['key'=>'YOUR_API_KEY']);
0 commit comments