private async Task SendRequests() { Session session = _hostAdapter.SelectedSession; var srequest = FiddlerMessageBuilder.CreateRequestFromSession(session); var sresponse = FiddlerMessageBuilder.CreateResponseFromSession(session); // CreateMessage var messagesLink = new MessagesLink(); var request = messagesLink.BuildPOSTRequest(_runscopeSettings.Bucket, srequest, sresponse); //es3pfvznehtn var response = await _Client.SendAsync(request); if (response.IsSuccessStatusCode) { var messageId = await messagesLink.ParseNewMessageId(response); // Share Message var sharedMessageLink = new SharedMessageLink(); var shareRequest = sharedMessageLink.BuildPUTRequest(_runscopeSettings.Bucket, messageId); var shareResponse = await _Client.SendAsync(shareRequest); var publicurl = await sharedMessageLink.ParsePublicUri(shareResponse); if (publicurl != null) { Process.Start(publicurl.AbsoluteUri); } } }
public void CreatePOSTRequest() { var link = new MessagesLink(); var request = link.BuildPOSTRequest("foo", new HttpRequestMessage() { RequestUri = new Uri("http://example.org") }, new HttpResponseMessage()); var result = request.Content.ReadAsStringAsync().Result; }