Beispiel #1
0
        public IActionResult Post(string accessToken)
        {
            if (!IsValidToken(accessToken))
            {
                return(StatusCode((int)HttpStatusCode.MethodNotAllowed));
            }

            if (string.IsNullOrWhiteSpace(Request.ContentType))
            {
                throw new NotSupportedException();
            }

            try
            {
                _writer.Write(Request, _model);

                return(Ok());
            }
            catch (Exception ew)
            {
                _logger.LogError(ew.ToString());

                throw ew;
            }
        }
Beispiel #2
0
 public void Replay(IHttpWriter writer)
 {
     writer.Write(stream =>
     {
         lock (_locker)
         {
             _stream.Position = 0;
             _stream.CopyTo(stream);
         }
     });
 }
Beispiel #3
0
 public void Replay(IHttpWriter writer)
 {
     writer.Write(stream =>
     {
         lock (_locker)
         {
             _stream.Position = 0;
             _stream.CopyTo(stream);
         }
     });
 }
 public void Replay(IHttpWriter writer)
 {
     writer.Write(_text);
 }
Beispiel #5
0
 public void Write(string contentType, string renderedOutput)
 {
     _writer.WriteContentType(contentType);
     _writer.Write(renderedOutput);
 }
Beispiel #6
0
 public void Replay(IHttpWriter writer)
 {
     writer.Write(_text);
 }
Beispiel #7
0
 public void Execute(SwaggerUIRequest request)
 {
     _writer.Write(_cache.Get().PageContents);
 }