I’ve now done a substantial rewrite to better align with httr2, though a full alignment is not possible with the way it’s currently setup.
The user now dynamically registers a client with solid_client_register_dyn and the function req_oauth_solid_dpop transparently calls the authorisation flow, caches the access token (in memory for the moment), tests expiry and requests a new one with the refresh_token.
Examples are given for PUT, POST and PATCH too.
Note that this would presumably actually give a 404 error even when authorised. A POST creates a new resource in a container either with a URI issued by the server or using a slug provided in a header.
In this case, a slug is not provided, so the server would try to create a new randomly named resource in “manual%20copy%20paste”, and fail to do so unless it already exists as a container.
Using PUT would have the intended effect of creating a new resource named “manual%20copy%20paste” but a content type would still need to be provided otherwise the server would return an error 400.
There’s still a fair bit of work to do to make this R code user friendly