Last change
on this file since 454 was 454, checked in by alloc, 16 months ago |
24_29_43
Switched over to vanilla Web infrastructure
|
File size:
691 bytes
|
Line | |
---|
1 | using System.Net;
|
---|
2 | using System.Text;
|
---|
3 | using AllocsFixes.JSON;
|
---|
4 | using Webserver;
|
---|
5 | using HttpListenerResponse = SpaceWizards.HttpListener.HttpListenerResponse;
|
---|
6 |
|
---|
7 | namespace AllocsFixes {
|
---|
8 | public static class LegacyApiHelper {
|
---|
9 | public static void WriteJSON (HttpListenerResponse _resp, JSONNode _root) {
|
---|
10 | #if ENABLE_PROFILER
|
---|
11 | jsonSerializeSampler.Begin ();
|
---|
12 | #endif
|
---|
13 | StringBuilder sb = new StringBuilder ();
|
---|
14 | _root.ToString (sb);
|
---|
15 | #if ENABLE_PROFILER
|
---|
16 | jsonSerializeSampler.End ();
|
---|
17 | netWriteSampler.Begin ();
|
---|
18 | #endif
|
---|
19 | WebUtils.WriteText (_resp, sb.ToString(), HttpStatusCode.OK, WebUtils.MimeJson);
|
---|
20 |
|
---|
21 | #if ENABLE_PROFILER
|
---|
22 | netWriteSampler.End ();
|
---|
23 | #endif
|
---|
24 | }
|
---|
25 |
|
---|
26 | }
|
---|
27 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.