Ignore:
Timestamp:
Aug 7, 2022, 1:11:51 AM (2 years ago)
Author:
alloc
Message:

Finished up REST API base
Made API handler look for APIs in all loaded mods

Location:
binary-improvements2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • binary-improvements2

    • Property svn:ignore
      •  

        old new  
         1.idea
        12bin
        2 .idea
         3server-fixes.sln.DotSettings.user
  • binary-improvements2/MapRendering

    • Property svn:ignore
      •  

        old new  
         1bin
        12obj
  • binary-improvements2/MapRendering/Web/WebUtils.cs

    r387 r389  
    2525                        netWriteSampler.Begin ();
    2626#endif
    27                         WriteText (_resp, sb.ToString(), _mimeType: MimeJson);
     27                        WriteText (_resp, sb.ToString(), _statusCode, MimeJson);
    2828#if ENABLE_PROFILER
    2929                        netWriteSampler.End ();
     
    3232
    3333                public static void WriteText (HttpListenerResponse _resp, string _text, HttpStatusCode _statusCode = HttpStatusCode.OK, string _mimeType = null) {
     34                        _resp.StatusCode = (int)_statusCode;
     35                        _resp.ContentType = _mimeType ?? MimePlain;
     36                        _resp.ContentEncoding = Encoding.UTF8;
     37
    3438                        byte[] buf = Encoding.UTF8.GetBytes (_text);
    3539                        _resp.ContentLength64 = buf.Length;
    3640                        _resp.OutputStream.Write (buf, 0, buf.Length);
    37                        
    38                         _resp.ContentType = _mimeType ?? MimePlain;
    39                         _resp.ContentEncoding = Encoding.UTF8;
    40                         _resp.StatusCode = (int)_statusCode;
    4141                }
    4242
Note: See TracChangeset for help on using the changeset viewer.