Changeset 306 for binary-improvements/MapRendering/Web/API/WebAPI.cs
- Timestamp:
- Aug 2, 2017, 6:46:15 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/MapRendering/Web/API/WebAPI.cs
r279 r306 7 7 public abstract class WebAPI 8 8 { 9 public void WriteJSON (HttpListenerResponse resp, JSON.JSONNode root)9 public static void WriteJSON (HttpListenerResponse resp, JSON.JSONNode root) 10 10 { 11 11 byte[] buf = Encoding.UTF8.GetBytes (root.ToString()); … … 14 14 resp.ContentEncoding = Encoding.UTF8; 15 15 resp.OutputStream.Write (buf, 0, buf.Length); 16 } 17 18 public static void WriteText (HttpListenerResponse _resp, string _text) 19 { 20 byte[] buf = Encoding.UTF8.GetBytes (_text); 21 _resp.ContentLength64 = buf.Length; 22 _resp.ContentType = "text/plain"; 23 _resp.ContentEncoding = Encoding.UTF8; 24 _resp.OutputStream.Write (buf, 0, buf.Length); 16 25 } 17 26
Note:
See TracChangeset
for help on using the changeset viewer.