Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Add http module from LuaSocket to project. — Gideros Forum

Add http module from LuaSocket to project.

r4ger4ge Member
edited May 2013 in General questions
I try add http module from LuaSocket to my project, but fail.

My code:
local http = require("http")
os.exit()
Problem in ".\mime.lua:13: module 'mime.core' not found:"
I can't find this file, or file 'core.lua' to add in project.
Someone solved this problem?

Comments

  • first of all, if you are developing for the Mobile device, try not to use the
    os.exit()
    command

    Secondly http is part of the socket library, so try to require the socket library or
    local http = require("socket.http")
    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
  • r4ger4ge Member
    same problem.
  • ar2rsawseenar2rsawseen Maintainer
    Hello @r4ge ;)
    1) is there anything that UrlLoader can't handle, that you need http?
    2) most probably mime.core was incorporated in the main dll, so you may try commenting out require "mime.core" inside mime.lua
  • r4ger4ge Member
    edited May 2013
    Hello @ar2rsawseen

    1) i need to take and save cookies.
    2) look wrong and crush gideros player. I try example with real data from this: http://stackoverflow.com/questions/11167289/simulation-login-using-lua
  • ar2rsawseenar2rsawseen Maintainer
    edited May 2013
    @r4ge
    Ok I'v checked the source code and mime.core seems to be not included, will fix that in next version.

    But in the mean time, if you are not using any mime specific functions, it seems to be working for me, when commenting out the
    --local mime = require("mime.core")
    inside mime.lua which you added to the project.

    Copy pasting the code you provided it gives this response (tested on pc and Android device):

    Status: OK
    HTTP code: 404
    Response headers:
    date : Tue, 14 May 2013 06:22:10 GMT
    content-type : text/html; charset=utf-8
    connection : Close
    content-length : 10
    Response body:
    Not found

    Done dumping response
  • r4ger4ge Member
    edited May 2013
    @ar2rsawseen

    Thanks for that.

    If you want to see crash Gideros Player just try this:
    http = require("socket.http")
     
    local res, code, response_headers = socket.http.request{
    	url = "<a href="http://www.giderosmobile.com/forum&quot" rel="nofollow">http://www.giderosmobile.com/forum&quot</a>;
    }
Sign In or Register to comment.