Network Error: Invalid URL, Error cracking URL

Hello,

I am receiving “Network Error; Invalid URL; Error Cracking URL”  when attempting to download an image file. Process flow is:

JSON file received from server

Convert to LUA Table

Request image URL location from LUA table

local qstring1 = ‘"’

local qstring2 = newTable[“result”][1][“lead_image”]

local qstring3 = ‘"’

local mashtogether = qstring1…qstring2…qstring3

network.download( mashtogether, “GET”, networkListener,“image3”, system.TemporaryDirectory)

Console:

19:43:40.677 Failure cracking URL - “https://mls.mls-ecuador.com/api/images/rs1700457/rs1700457_img_preview.jpg_

19:43:40.677 Network error: Invalid URL

 

Link seems OK, could not find extra characters, etc… Perhaps I am missing a hidden character, and will be forced to parse the string?

Thank you

Instead of adding quotes (qstring1 and qstring3), try this instead:

https://docs.coronalabs.com/tutorial/data/encodeURL/index.html

Hello Ingemar,

First try using the encode function seems to mangle the URL worse,  I will attempt some more combinations with the LUA table variables. Example from the docs demonstrates a query added to a hard URL, which I am not doing but should not matter. 

Thanks,  Bryan

The problem seems to be a timing issue, I was able to “slow” a few steps down in my code, and now just calling the variable URL value is working without modification.  I am seeing some other issues (warnings: image on drive does not match), which may be timing problems, will try some additional experimentations. 

Instead of adding quotes (qstring1 and qstring3), try this instead:

https://docs.coronalabs.com/tutorial/data/encodeURL/index.html

Hello Ingemar,

First try using the encode function seems to mangle the URL worse,  I will attempt some more combinations with the LUA table variables. Example from the docs demonstrates a query added to a hard URL, which I am not doing but should not matter. 

Thanks,  Bryan

The problem seems to be a timing issue, I was able to “slow” a few steps down in my code, and now just calling the variable URL value is working without modification.  I am seeing some other issues (warnings: image on drive does not match), which may be timing problems, will try some additional experimentations.