Sfoglia il codice sorgente

Use RFC 4627 MIME type for JSON in examples

The MIME media type for JSON is application/json with default encoding is UTF-8, according to RFC 4627.
bel2125 6 anni fa
parent
commit
bc37b0bf75
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      test/luarest/api/1/sensors/index.lua

+ 1 - 1
test/luarest/api/1/sensors/index.lua

@@ -56,7 +56,7 @@ end
 
 local response_body = json.stringify(response_table)
 mg.write("HTTP/1.1 " .. http_status .. "\r\n")
-mg.write("Content-Type: application/javascript; charset=UTF-8\r\n")
+mg.write("Content-Type: application/json; charset=UTF-8\r\n")
 mg.write("Content-Length: ".. #response_body .."\r\n")
 mg.write("\r\n")
 mg.write(response_body)