![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 7 of 7 total |
![]() |
Thu, Feb 16 2017 11:56 PM | Permanent Link |
Steve Gill | I'm using EWB with PHP and the CodeIgniter 3 framework on the backend.
Using the database features of EWB I can retrieve data successfully from the PHP app by returning it as JSON. However, I am having a problem when EWB has to send parameters. It seems EWB is using GET, but CodeIgniter is by default set up to use POST. This means that the PHP code gets the request fine but it can't read the parameters. There are ways to make CodeIgniter use GET but it GETs a bit messy. ![]() Is it possible for the database functionality to use POST or does it only use GET? Am I hitting my head against a POST trying to GET this to work? ![]() = Steve |
Fri, Feb 17 2017 7:10 AM | Permanent Link |
Steve Gill | For now I'm using TServerRequest to post the parameters to the PHP code and using TDataset.LoadRows to load the returned JSON data.
= Steve |
Mon, Feb 20 2017 4:30 AM | Permanent Link |
Matthew Jones | Steve Gill wrote:
> However, I am having a problem when EWB has to send parameters. It seems EWB is using GET, but CodeIgniter is by default set up to use POST. I'd like to pick up on this. Am I right in reading your message as EWB is using GET to "send data" to the server? If so, it really needs to be changed. That is not a good way to do it. I know, I fell over this myself. The primary issue is outlined here: http://stackoverflow.com/questions/3477333/what-is-the-difference-between-post-and-get "GET requests a representation of the specified resource. Note that GET should not be used for operations that cause side-effects, such as using it for taking actions in web applications. One reason for this is that GET may be used arbitrarily by robots or crawlers, which should not need to consider the side effects that a request should cause." The POST should be used when the client is requesting data changes. Even if all the data is in the parameters of the URL. I hope I am mis-reading your post... -- Matthew Jones |
Mon, Feb 20 2017 9:24 PM | Permanent Link |
Raul ![]() | On 2/16/2017 11:56 PM, Steve Gill wrote:
> I'm using EWB with PHP and the CodeIgniter 3 framework on the backend. > Using the database features of EWB I can retrieve data successfully from the PHP app by returning it as JSON. However, I am having a problem when EWB has to send parameters. It seems EWB is using GET, but CodeIgniter is by default set up to use POST. > This means that the PHP code gets the request fine but it can't read the parameters. There are ways to make CodeIgniter use GET but it GETs a bit messy. ![]() > Is it possible for the database functionality to use POST or does it only use GET? > Am I hitting my head against a POST trying to GET this to work? ![]() Steve, AFAIK EWB uses strictly GET for any "get data" requests - params are basically used for filtering (i.e. sql "where") but it's still very much read only data retrieval operation. POST is strictly used for actual data update - dataset transactions. This usage is pretty normal for rest style APIs. There can be some value in using post (larger params and not getting logged on server) but then you lose ability to use same api URL for multiple operations which would be a major drawback IMHO. Raul |
Mon, Feb 20 2017 9:26 PM | Permanent Link |
Raul ![]() | On 2/20/2017 4:30 AM, Matthew Jones wrote:
> I'd like to pick up on this. Am I right in reading your message as EWB is using GET to "send data" to the server? If so, it really needs to be changed. That is not a good way to do it. I know, I fell over this myself. "Send data" only in terms of "these are param values you should use for query" - result is still read-only query to retrun some data to EWB app. > "GET requests a representation of the specified resource. Note that GET should not be used for operations that cause side-effects, such as using it for taking actions in web applications. One reason for this is that GET may be used arbitrarily by robots or crawlers, which should not need to consider the side effects that a request should cause." Not a concern here IMHO. > The POST should be used when the client is requesting data changes. Even if all the data is in the parameters of the URL. EWB does use POST for insert/update/delete (i.e. transactions). Raul |
Mon, Feb 20 2017 10:26 PM | Permanent Link |
Steve Gill | Hi Raul,
<< AFAIK EWB uses strictly GET for any "get data" requests - params are basically used for filtering (i.e. sql "where") but it's still very much read only data retrieval operation. POST is strictly used for actual data update - dataset transactions. This usage is pretty normal for rest style APIs. There can be some value in using post (larger params and not getting logged on server) but then you lose ability to use same api URL for multiple operations which would be a major drawback IMHO. >> Got it. Thanks. = Steve |
Tue, Feb 21 2017 4:01 AM | Permanent Link |
Matthew Jones | Raul wrote:
> "Send data" only in terms of "these are param values you should use for query" - result is still read-only query to retrun some data to EWB app. Phew, would have been surprised any other way. Just your problem then. 8-) -- Matthew Jones |
This web page was last updated on Wednesday, November 29, 2023 at 09:43 PM | Privacy Policy![]() © 2023 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |