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
Allow passing parameters as a pre-encoded string (or something that allows casting to a string). Parameters passed as strings will not be merged with parameters specified in the default options.
Update documentation with PATCH JSON recommendations.
Copy file name to clipboardExpand all lines: README.markdown
+27-4Lines changed: 27 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -52,13 +52,36 @@ Verbs
52
52
-----
53
53
Four HTTP verbs are implemented as convenience methods: `get()`, `post()`, `put()` and `delete()`. Each accepts three arguments:
54
54
55
-
`url` - URL of the resource you are requesting. Will be prepended with the value of the `base_url` option, if it has been configured. Will be appended with the value of the `format` option, if it has been configured.
56
-
`parameters` - An associative array of query parameters, which will be formatted with the URL in `GET` requests, and passed in the request body on all others.
57
-
`headers` - An associative array of headers to include with the request.
55
+
`url` - `string` URL of the resource you are requesting. Will be prepended with the value of the `base_url` option, if it has been configured. Will be appended with the value of the `format` option, if it has been configured.
56
+
57
+
`parameters` - `string` or associative `array` to be appended to the URL in `GET` requests and passed in the request body on all others. If an array is passed it will be encoded into a query string.
58
+
59
+
`headers` - An associative `array` of headers to include with the request.
58
60
59
61
You can make a request using any verb by calling `execute()` directly, which accepts four arguments: `url`, `method`, `parameters` and `headers`. All arguments expect the same values as in the convenience methods, with the exception of the additional `method` argument:
60
62
61
-
`method` - HTTP verb to perform the request with.
63
+
`method` - `string` HTTP verb to perform the request with.
64
+
65
+
66
+
JSON Verbs
67
+
----------
68
+
This library will never validate or construct `PATCH JSON` content, but it can be configured to communicate well-formed data.
Note that your specific endpoint may not require the `X-HTTP-Method-Override` header, nor understand the [correct](http://tools.ietf.org/html/rfc6902#section-6)`application/json-patch+json` content type.
0 commit comments