question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Respect full URLs even if using a provider

See original GitHub issue

If 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:closed
  • Created 5 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
kallaspriitcommented, Jan 30, 2019

I’m pretty busy right now, got a deadline to meet. It would be easier for You to do the simple docs update directly?

1reaction
kallaspriitcommented, Jan 30, 2019

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 of path with a similar example as your initial comment.

Right now the docs don’t directly mention that <Get> even accepts a base attribute.

Also the highlight link range does not cover all parameters 😃 https://github.com/contiamo/restful-react/blob/master/src/Get.tsx#L50-L87

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found