ArunPrakashG / wordpress_client

A powerful and easy-to-use WordPress REST API client for Dart & Flutter.
MIT License
33 stars 12 forks source link

Is there a way to add authorization at the request level? #73

Closed nathanael540 closed 2 months ago

nathanael540 commented 2 months ago

``I'm having trouble getting a list of posts with status posts like "future". Looking at the logs, I believe it is due to a lack of authorization in the "client.posts.list" request.

Is there a way to add authorization at the request level?

Sorry if this has already been mapped out, but I haven't found a solution for this.

{"code":"rest_invalid_param","message":"Parâmetro(s) inválido(s): status","data":{"status":400,"params":{"status":"O status é proibido."},"details":{"status":{"code":"rest_forbidden_status","message":"O status é proibido.","data":{"status":401}}}}}

Thanks

ArunPrakashG commented 2 months ago

@nathanael540 Hey, apologies for the late response. I believe every request class as authorization property to which you can pass a class which implements IAuthorization. This should work for you case.