public string Add(IOrientObject obj_) { string content = jm.SerializeObject(obj_); List <ITypeToken> commandTk = tb.Command(new OrientCreateToken(), obj_, obj_, new TextToken() { Text = content }); string command = txb.Build(commandTk, new OrientCreateVertexCluaseFormat()); queryUrl = CommandUrl + "/" + command; owm.Authenticate(AuthUrl, new NetworkCredential(ConfigurationManager.AppSettings["ParentLogin"], ConfigurationManager.AppSettings["ParentPassword"])); string resp = ir.ReadResponse( owm.GetResponse(queryUrl, new POST().Text) ); return(resp); }
private async Task <IActionResult> ActionResult(Guid id, string httpMethod, Stream requestBody) { var response = await _reader.ReadResponse(httpMethod, id); using (var streamReader = new StreamReader(requestBody)) { var body = await streamReader.ReadToEndAsync(); _historyHandler.AppendRequest(id, new RequestResponse { Id = Guid.NewGuid(), Timestamp = DateTime.UtcNow, HttpMethod = httpMethod, ResponseBody = response, RequestBody = string.IsNullOrWhiteSpace(body) ? JsonDocument.Parse("{}").RootElement : JsonDocument.Parse(body).RootElement } ); } return(_helper.CreateHttpResponse(response)); }