unjs / unjs/ofetch

Request method to function alias

Open
#282 0 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
5.4k
Forks
195
PR merge metrics
No merged PRs in 30d

Description

Describe the feature

Hi, is it possible to have the request method as a function alias on ofetch as it's on axios where we have something like
$fetch.get('url', {config})
$fetch.post('url', {config})

https://github.com/axios/axios#request-method-aliases

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting ofetch's request API and how its exported fetch function is constructed; the issue does not name a file or test. Add method aliases corresponding to the requested GET and POST examples, preserving the existing URL and config behavior, and verify that both forms produce the expected requests.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.