File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -141,10 +141,34 @@ export default function createClientApi ({ http }) {
141
141
. then ( ( response ) => wrapOrganizationCollection ( http , response . data ) , errorHandler )
142
142
}
143
143
144
+ /**
145
+ * Make a custom request to the Contentful management API's /spaces endpoint
146
+ * @memberof ContentfulClientAPI
147
+ * @param {Object } opts - axios request options (https://github.com/mzabriskie/axios)
148
+ * @return {Promise<Object> } Promise for the response data
149
+ * @example
150
+ * const contentful = require('contentful-management')
151
+ *
152
+ * const client = contentful.createClient({
153
+ * accessToken: '<content_management_api_key>'
154
+ * })
155
+ *
156
+ * client.rawRequest({
157
+ * method: 'GET',
158
+ * url: '/custom/path'
159
+ * })
160
+ * .then((responseData) => console.log(responseData))
161
+ * .catch(console.error)
162
+ */
163
+ function rawRequest ( opts ) {
164
+ return http ( opts ) . then ( ( response ) => response . data , errorHandler )
165
+ }
166
+
144
167
return {
145
168
getSpaces : getSpaces ,
146
169
getSpace : getSpace ,
147
170
createSpace : createSpace ,
148
- getOrganizations : getOrganizations
171
+ getOrganizations : getOrganizations ,
172
+ rawRequest : rawRequest
149
173
}
150
174
}
You can’t perform that action at this time.
0 commit comments