@@ -269,7 +269,9 @@ export default class Kitsu {
269269 * @memberof Kitsu
270270 * @param {string } model Model to create a resource under
271271 * @param {Object|Object[] } body Data to send in the request
272- * @param {Object } [headers] Additional headers to send with the request
272+ * @param {Object } [config] Additional configuration
273+ * @param {Object } [config.params] JSON:API request queries. See [#get](#get) for documentation
274+ * @param {Object } [config.headers] Additional headers to send with the request
273275 * @returns {Object|Object[] } JSON-parsed response
274276 * @example <caption>Create a post on a user's profile feed</caption>
275277 * api.create('posts', {
@@ -289,8 +291,10 @@ export default class Kitsu {
289291 * { content: 'Another post' }
290292 * ])
291293 */
292- async post ( model , body , headers = { } ) {
294+ async post ( model , body , config = { } ) {
293295 try {
296+ const headers = merge ( this . headers , config . headers )
297+ const params = merge ( { } , config . params )
294298 const [ resourceModel , url ] = splitModel ( model , {
295299 resourceCase : this . resCase ,
296300 pluralModel : this . plural
@@ -301,7 +305,11 @@ export default class Kitsu {
301305 camelCaseTypes : this . camel ,
302306 pluralTypes : this . plural
303307 } ) ,
304- { headers : Object . assign ( this . headers , headers ) }
308+ {
309+ headers,
310+ params,
311+ paramsSerializer : /* istanbul ignore next */ p => query ( p )
312+ }
305313 )
306314
307315 return deserialise ( data )
0 commit comments