is it better to add more methods or pass parameters when encapsulating some general methods?
for example, I re-encapsulate the ajax of jq.
the first method is as follows. The request method is put in the parameters. For example, type can be post or GET
request({
type:POST,
url:xxxx,
data:{}
})
the second method is as follows, and a separate method is added
request.get({
url:xxxx,
data:{}
})
request.post({
url:xxxx,
data:{}
})
the above is a simple example, which is roughly what it means. Which of these two methods is better?