BUG - Network.request not accepting queries in the URL when running on Android.

Actually I tried both and got the same behavior on Android device. It’s a simple get request for parse users sorted by their XP value and limited to top 25. I don’t have it near me so can’t send the actual URL.

Ok I assumed this bug and you problem might be related because it way not working android and I just remembered this bug. But post the url when you get a chance.

I think you nailed it. Good catch as I did not see this thread. I will try to file a bug report end of next week when I’m back from our family vacation. I don’t understand how such a bug evaded the core team for so long. It seems a very basic behavior that many encounter. Unless there is some obvious workaround I’m not familiar with.

I’ve tried the new update of parse plug-in and still get the issue. I wondered since the plug-in uses native libs if it could have avoided the issue, but probably they use the default network lib by Corona, so the issue remains.

I will open a bug for that

Can you post a sample request you are using? I have a custom parse database I can try it on.

Hi,

I’m not sure how the request is sent since there is no way to know what network.request compiles. However, the input to this method for example is: (users table assumes to have the following additional columns: xp,rank,play,win)

url:

<your self hosted parse base url>/users

body:

{“order”:"-xp",“limit”:7,“keys”:“username,xp,rank,play,win”}

headers:

Accept: application/json

Content-Length: 60

Content-Type: application/json

X-Parse-Application-Id: <your app id>

X-Parse-REST-API-Key: <your rest API key>

X-Parse-Session-Token: <your session token>

When sent via simulator, this returns exactly 7 entries, sorted by most XP. When sent via android device, this returns all entries in the table, unsorted.

Hello Everyone, 

Has this bug been fixed yet? A major feature in my application depends highly on this to work. I have successfully integrated Google Drive into my application, but multiple queries must be in the URL in order for it to work. My application is currently only available on Android, and I am looking to release this update in the next week for my customers. Please fix this ASAP!

Thanks,

Feliz Games

I have a drive plugin on the way and it works fine. The big problem I believe was the way the url was written. If you have having trouble with this and you believe this is a bug then report it. The worst corona can say is it not a bug and explain why it is not a bug. https://developer.coronalabs.com/content/bug-submission

Hello Scottrules44,

Can you possibly help me fix the issue I have?

How should the url be written? Like can you give me an example?

Thanks,

Estevan

function modParams(url, params)
local newURL = url … “?”
local first_arg = true
for i, v in pairs(params) do
if first_arg == false then
newURL = newURL … “&”
newURL = newURL … i … “=” … v
else
newURL = newURL … i … “=” … v
first_arg = false
end
end

local actualURL = nil
local url = "https://www.googleapis.com/drive/v3"
local requestParameters={}–enter params here
local myBody = {}–enter body here
local params = {}
local headers = {}
headers[“Content-Type”] = “application/json”
headers[“Authorization”] = "Bearer " … access_token
params.headers = headers
params.body = json.encode(myBody)
actualURL = modParams(url, requestParameters)
network.request(actualURL, method, function(event)
print(event.response)
end, params)

Hopefully my drive plugin get looked at soon. I have been waiting since July 6

Haha hopefully, I just watched the video that you were in. My question is with the plugin you demoed the application uploaded an arrow file when you pressed the request button. Were you able to do anything else with the plugin? I was able to upload and download files with my application. There will be a forum post here once I finish the update. The application has been released and available since August of last year. I got Google Drive integration to work, but I will look into this multiple query issue soon. If you want to check out my application check it out here: www.drivepad.weebly.com

Thanks,

Estevan

You should be able to do anything with the drive api. I have test uploading, deleting, downloading, and updating.

Edit: ^refering to files

What works fine?

If you use the params in the URL (as in GET) it will work for some servers, but query with GET is not supported on self hosted parse (dont know why but it doesn’t work, try it).

However, the method I showed (using the query arguments in the body) does work on the simulator but not on android. Problem is, I don’t really know what to show corona staff in the bug. I don’t have a test server for them to play with and I doubt they have one of their own.

Can you describe how you’re self-hosting Parse? Is it it’s own web server? Is it dependent on Apache or nginx? GET and POST are HTTP requests and have to be handled by a web server or something that responds as a web server.

Are you running this on your computer or you hosting it?

Rob

Also are you using the parse plugin on marketplace, mod_parse which is something Chris wrote long ago, another plugin or module I have not heard of ,or your own solution.

We use an ubunto cartridge on openshift. it has the basic express + nodejs implementation for parse. It works well except that one issue with queries. 

Do you have a different hosted parse version which works fine on such query?

We have the latest marketplace plug-in and mod_parse with latest fixes, switching between the two for each test hopefully to get something working.

I’ve filed https://github.com/coronalabs/corona/issues/201 for this issue.

Hi, We’ve been using back4app for the past few years without issues. If needed I can supply the source code we use to call their service