$post and $get helpers to wrap around $fetch #104
Answered
by
SimoTod
KevinBatdorf
asked this question in
Ideas
-
To do a post request you do: $fetch({
method: 'post',
url: '/user/12345',
data: {
firstName: 'Fred',
lastName: 'Flintstone'
}
}) This is fine, but better would be: $post(url, options)
|
Beta Was this translation helpful? Give feedback.
Answered by
SimoTod
Mar 17, 2021
Replies: 1 comment
-
It makes sense and it's probably just a few bytes. I wonder if they should just be $post(
'/user/12345',
{firstName: 'Fred', lastName: 'Flintstone'}
) If someone needs to pass custom options, they can use the full featured |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
SimoTod
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It makes sense and it's probably just a few bytes. I wonder if they should just be
$post(url, data)
and$get(url)
to cover the simple cases.For example
If someone needs to pass custom options, they can use the full featured
$fetch
.