Convenience features for `NextcloudRequest.Builder`
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start at the NextcloudRequest.Builder implementation and inspect how setUrl, setParameter, and the HTTP method are stored before build(). Compare the requested URL parsing with the linked Kotlin sample, then verify that URL parameters are included, GET is the default, and an explicitly selected method still works.
Written by the indexing model from the issue text.
Description
Issue
The following setup for a NextcloudRequest is quite verbose:
final var parameters = Collections.singleton(new QueryParam("foo", "bar"));
final var nextcloudRequest = new NextcloudRequest.Builder()
.setMethod("GET")
.setParameter(parameters)
.setUrl("/endpoint")
.build();
Especially for beginners, we should try to minimize the necessary boilerplate code to perform an actual request.
Proposal
Automatically parse QueryParams from the given URL
We could parse the QueryParams from the given URL and add them to our Collection (just as if .setParameter() would have been called). A working sample implementation (in Kotlin) is already in the nextcloud-commons library available.
final var nextcloudRequest = new NextcloudRequest.Builder()
.setMethod("GET")
.setParameter(parameters)
.setUrl("/endpoint?foo=bar")
.build();
Default method property to GET
It is the most often used HTTP verb and a natural choice to be preset (of course with keeping the possibility to override it):
final var parameters = Collections.singleton(new QueryParam("foo", "bar"));
final var nextcloudRequest = new NextcloudRequest.Builder()
.setParameter(parameters)
.setUrl("/endpoint")
.build();
Looking forward to some opinions 🙂
PS.: This issue has been split out of #266
- Dominant language
- Java
- Stars
- 74
- Forks
- 36
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 15
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nextcloud/Android-SingleSignOn
-
0. Needs triage bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nextcloud/Android-SingleSignOn#1081 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
nextcloud/Android-SingleSignOn#563 · 2 comments · 1 reaction ·
-
0. Needs triage bug
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
nextcloud/Android-SingleSignOn#894 · 1 reaction ·
-
0. Needs triage bug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
nextcloud/Android-SingleSignOn#859 · 3 comments ·
-
0. Needs triage enhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
All issues in nextcloud/Android-SingleSignOn
Similar issues
-
awaiting triage bug Causes friction Hop Gui P1 P2 Transforms
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
apache/flink-agents#1152 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
jenkinsci/blueocean-plugin#5417 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
objectionary/eo-graphs#75 ·