Respect full URLs even if using a provider
See original GitHub issueIf I do use a <RestfulProvider base="https://example.com/api">
but then make a request using full URL (https://example.com/api/xxx
etc), it should use the provided URL not concatenate them together.
Right now this
<RestfulProvider base="https://example.com/api">
<Get path="https://reqres.in/api/users">
...
</Get>
</RestfulProvider>
Results in attempting to fetch URL https://example.com/apihttps://reqres.in/api/users
but it should just use the provided URL https://reqres.in/api/users
.
Makes sense that most of my requests go to my own API for which I have added the RestfulProvider
but perhaps I want to make some requests to 3rd party API so for those requests, I would provide the full URL and expect the provider base to be ignored.
Tested on React native but it’s likely the same on the web.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Everything You Need to Know About URL Masking
With URL masking, you can hide your website's file paths. ... Duplicate content — even if it's not malicious — hurts your SEO...
Read more >Understanding and configuring Cloudflare Page Rules (Page ...
Page Rules trigger certain actions whenever a request matches one of the URL patterns you define. Learn to create and edit page rules...
Read more >5 common mistakes with rel=canonical - Google Developers
Mistake 1: rel=canonical to the first page of a paginated series · Mistake 2: Absolute URLs mistakenly written as relative URLs · Mistake...
Read more >What happens when you type a URL into your browser? - AWS
Without an extension, like this URL, it usually indicates the server generated this content.
Read more >Methods for De-identification of PHI - HHS.gov
3.8 Must a covered entity suppress all personal names, such as physician ... Health information that does not identify an individual and with...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m pretty busy right now, got a deadline to meet. It would be easier for You to do the simple docs update directly?
I guess You could just add a short section under the provider description that do make a request to another host,
base
should be set instead ofpath
with a similar example as your initial comment.Right now the docs don’t directly mention that
<Get>
even accepts abase
attribute.Also the highlight link range does not cover all parameters 😃 https://github.com/contiamo/restful-react/blob/master/src/Get.tsx#L50-L87