B4J Question Pakai API URL element parameters

aeric

Expert
Licensed User
Longtime User
The best I would suggest is to use POST.
By understanding the difference between using GET and POST, you will know that POST is better choice to handle such request.
 
Upvote 0

Davisbc

Member
Licensed User
Unfortunately, that is the standard for this type of service. i will try and write a handler.
I am currently using a pre-v6 PAKAI library. should i update to that server and make my changes from there?

Thanks,
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
Unfortunately, that is the standard for this type of service. i will try and write a handler.
I am currently using a pre-v6 PAKAI library. should i update to that server and make my changes from there?

Thanks,
GET is usually use for downloading a resource.
While you still can use it for sending data to the server from a client by passing some parameters, it's behaviour is diferent from POST method.

You still can create it as a GET endpoint and use it but I will avoid it.

Reason I will use it:
1. I can use browser to call the endpoint :)
2. I don't need deal with the request body (but I also can use POST without body)
3. For simple and short URL with less parameters
4. For parameters that I am 100% sure well HTML encoded and escaped
5. I am not dealing with database non-query execution :rolleyes:

Reason I will avoid it:
1. I am not sure my parameters have special characters that can cause unexpected processing in the server 🤔
2. I don't want the URL looks so messy. I want the URL look more elegant and simpler. 🤗
3. I don't want duplicate rows inserted or executed more than once in the database backend 🤨
4. I don't need to concern about the browser or client URI size limitation 🥲
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
I am currently using a pre-v6 PAKAI library. should i update to that server and make my changes from there?
Pakai v6 is not ready for creating Web API server out of the box.
This version is a different beast, emphasized more on the frontend.
It doesn't depend on WebApiUtils that facilitate the creation of API.
I am developing a solution for Pakai v6 to make it also suitable for creating API server.
Conclusion is to use Pakai v4 or v5 if you want to create Web API for now.
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
For those who want to try on an early version that incorporate Web API with Pakai v6, please check this post.
 
Upvote 0
Top