HTTP POST Method (Content-Type)

For whatever reason I’m having issues making a POST using Content-Type… When making a request from either Fiddler or HTTP Debugger, the server side returns a 200 status. If I send it from Vera it never receives a status. What’s odd, it looks as if (within HTTP Debugger) the Content-Type isn’t being processed (see image). I’m hoping the solution is simple and I’m just over thinking this… Any help is appreciated…

POST /json HTTP/1.1
Host: 192.168.2.236
Cache-Control: no-cache
Content-Length: 15

{"name":"cuda"}

HTTP/1.1 200 OK
Server: Testing-HTTP/1.1
Date: Sat, 10 Jan 2015 22:40:58 GMT
P3P: CP="CAO COR CURa ADMa DEVa OUR IND ONL COM DEM PRE"
Access-Control-Allow-Origin: *
Set-Cookie: session=734b3f0d67c310f63d50596d5a0a2160; path=/;
Connection: Close
Content-Type: application/json
Content-Length: 15

{"result":"ok"}

And here is the result when sent from Vera (3).

POST /json HTTP/1.1
connection: close, TE
user-agent: LuaSocket 2.0.2
te: trailers
content-type: application/json
host: 192.168.2.236
Content-Length: 15

{"name":"cuda"}

And here is the LUA running in the scene (very simple).

local http 		= require "socket.http"
local ltn12 	= require "ltn12"
local json 		= require "json"


local reqbody 	= json.encode({name="cuda"})
local respbody	= {} 
	
	
    local  body, code, headers, status = http.request {
        method = "POST",
        url = "http://192.168.2.236/json",
        source = ltn12.source.string(reqbody),
        headers = 
                {
                        ["Content-Type"] = "application/json",
                        ["Content-Length"] = string.len(reqbody)
                },
        sink = ltn12.sink.table(respbody)
    }

I ran the code on a linux system setup with the same versions of lua/luasocket/luasec as vera and also on a veralite ui7 machine. (luasocket 2.0.2) I don’t see any issues with the request/response although I just get a 404 since I don’t actually have the requested page. The odd thing is the capitalized Content-Length. Mine is lower cased and the luasocket http code will do this for all your headers. I don’t understand why it would not be lower in your case. I see the same requests from both machines. One other oddity, my vera does not have json.lua, looks like it was renamed to json-dm (I think dkjson is also there). I had to edit the source to get it to run. Do you have a different json library on your machine ?

I have 3 json libraries, one from DM, the other straight json and one I added from this forum - akb-json… I’ve pretty much exhausted all ideas on getting this to work, well at least for tonight (pours another drink). For whatever reason everything else I POST to works (e.g. Hue bridge) without complaint. Everything but the Blue Iris servlet that is…

I’m open to ideas …

Welp, I went ahead and restored from a previous backup just in the unlikely event something went haywire. And yes, this has corrected my issue… Status 200, a wonderful thing…