2
    local body = "userId=31"
    local params = {}
    params.body = body

network.request( server/someifle.php", "POST", networkListenerRequests, params))

everything work fine, but at some random moments, I get an error in the networkListenerRequests.

If you read this post on stack overflow, Spring Rest Template usage causes EOFException they mention something about an attribute keep alive. Can this be set in corona or does anyone know anything else I can do?

The error message: E/Corona (20560): ERROR: null W/System.err(20560): java.io.EOFException W/System.err(20560): at libcore.io.Streams.readAsciiLine(Streams.java:203) W/System.err(20560): at libcore.net.http.HttpEngine.readResponseHeaders(HttpEngine.java:579) W/System.err(20560): at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:827) W/System.err(20560): at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:283) W/System.err(20560): at libcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:497) W/System.err(20560): at network.NetworkRequest$AsyncNetworkRequestRunnable.run(NetworkRequest.java:1394) W/System.err(20560): at java.lang.Thread.run(Thread.java:841)

Community
  • 1
  • 1
hidayat
  • 9,493
  • 13
  • 51
  • 66

1 Answers1

1

you can change any header of HTTP request with params.headers In your case it will look like this

local body = "userId=31"
local params = {}
params.body = body
params.headers = {};

params.headers["Connection"] = "close";

network.request("server/someifle.php", "POST", networkListenerRequests, params))

Hope this helps

iBad
  • 286
  • 2
  • 14