First of all I'll start with the snippet that you can find on rtk official documentation webpage.

```js
import { fetchBaseQuery } from '@reduxjs/toolkit/query'
import { tokenReceived, loggedOut } from './authSlice'

const baseQuery = fetchBaseQuery({ baseUrl: '/' })
const baseQueryWithReauth = async (args, api, extraOptions) => {
  let result = await baseQuery(args, api, extraOptions)
  if (result.error && result.error.status === 401) {
    // try to get a new token
    const refreshResult = await baseQuery('/refreshToken', api, extraOptions)
    if (refreshResult.data) {
      // store the new token
      api.dispatch(tokenReceived(refreshResult.data))
      // retry the initial query
      result = await baseQuery(args, api, extraOptions)
    } else {
      api.dispatch(loggedOut())
    }
  }
  return result
}

```

Everything looks fine at first glance, but my refresh token endpoint expects the method to be `PUT`, not `GET`.

How can I perform a `PUT` request inside this function after receiving a `401 Unauthorized` response, using `fetchBaseQuery` as provided by React Toolkit Query (RTK Q) library?

I also store my token in local storage, while the RTK Q example stores the token in redux state. Not sure if this is relevant information, but still.

I tried changing the example to use native `fetch()` after checking for the `401` error, and it works almost fine. I am receiving a new token and swapping it out, but for example when I refresh the page after the token expired, it doesn't work properly.