Skip to content
This repository has been archived by the owner on Feb 17, 2022. It is now read-only.

Two questions #30

Open
lighth7015 opened this issue Jul 6, 2020 · 4 comments
Open

Two questions #30

lighth7015 opened this issue Jul 6, 2020 · 4 comments

Comments

@lighth7015
Copy link

lighth7015 commented Jul 6, 2020

Hi,
I have just recently stumbled across this, and it's basically perfect for my website, and have a couple questions about library use-

First question: Some of my API is GET-based. I'm having a difficult time working out how to specify what HTTP method my client will use.
Second question: Seeing as some of my API uses GET requests, I can't pass parameters, how do I prevent internal errors from occurring when I supply no parameters to my GET-based APIs?

Thanks!

@lighth7015 lighth7015 changed the title Methods other than POST? Two questions Jul 6, 2020
@ayroblu
Copy link
Contributor

ayroblu commented Jul 6, 2020

Hey, just wondering why you need the GET requests? The purpose of POST is so that we can always include a bundle of parameters and that we don't really need to think about it cause it's meant to be rpc. Is it impossible to switch to using POST?

@lighth7015
Copy link
Author

We use GET requests, because it's fetching static, unauthenticated (from the perspective of the API) data. I'm writing essentially a home-grown React CMS, and I need to GET information from an endpoint that uses the HTTP_REFERRER to figure out what site you're looking at. I know it's not great, but it's a start.

@ayroblu
Copy link
Contributor

ayroblu commented Jul 6, 2020 via email

@lighth7015
Copy link
Author

It's a pain to get POST requests to work on laravel, and I'd rather not unprotect routes just because they don't require authentication. It's just easier for me to work with GET requests, since these dont' need to pass any data. But either way, I'll figure something out. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants