đ§°Lib Developers
This is for lib developers only not API users!
Last updated
This is for lib developers only not API users!
Last updated
This page is only for library developers. API users need to use the endpoints listed in the sidebar.
Here is what an API client lib should look like.
The http client should always include an Authorization
header for every request and an optional header for User-Agent
to show the library name or project/bot name.
The base class should be FluxpointClient with a category for each types of endpoints to use.
So this should be used by users like Client.Test.GetTestImage()
or Client.Sfw.GetNeko()
You should also include a TestAuthentication() method so the user can check if they are authenticated properly.
You should create a main SendRequest() method that can be used for all endpoints. This will include the HttpMethod (get/post) ApiType (Fluxpoint/Gallery) Path (Endpoint to use) Content (Optional body content this should include string/json support. The output response you recieve should include the default response of success, code and message and any optional data from the endpoint you use.
This should be the same as Send Request but the response you get will contain raw image data (bytes) that you should handle.
Some http clients/libs may require sending a POST request to use json body.
All endpoints need to have a category so that users can find them easily.
You can use the SendRequest()
method to send a GET request to https://api.fluxpoint.dev/me
Users should then be able to use this with Client.Misc.GetMeAsync()