Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: HEAD requests #541

Open
julienmonnard opened this issue Mar 29, 2024 · 0 comments
Open

Feature request: HEAD requests #541

julienmonnard opened this issue Mar 29, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@julienmonnard
Copy link

julienmonnard commented Mar 29, 2024

It seems that currently, according to these types, the AppRoute is currently not supporting HEAD requests.

/**
* A query endpoint. In REST terms, one using GET.
*/
export type AppRouteQuery = AppRouteCommon & {
method: 'GET';
};
/**
* A mutation endpoint. In REST terms, one using POST, PUT,
* PATCH, or DELETE.
*/
export type AppRouteMutation = AppRouteCommon & {
method: 'POST' | 'DELETE' | 'PUT' | 'PATCH';
contentType?:
| 'application/json'
| 'multipart/form-data'
| 'application/x-www-form-urlencoded';
body: ContractAnyType;
};

They act pretty much like a GET request, but do not provide a body in the response. This can be useful sometimes, when only want to know the status of the request, or something related to the headers, without having to download the whole content of the response.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/HEAD

Is there any way to handle these in this library? I would also make use of the react-query wrapper, I don't know if something is needed here as well, of it inherits it from the core package.

@Gabrola Gabrola added the enhancement New feature or request label Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants