public void Does_serialize_request() { var client = new JsonHttpClient(Config.ListeningOn); var response = client.Put(new PutConfirmed { Confirmations = new List <Confirmation> { new Confirmation { ChangeId = 126552616, Confirmed = true, } } }); Assert.That(response.IsSucceed); }
public void PostFileWithRequest_returns_the_same_date_as_normal_Put_with_JsonHttpClient() { var client = new JsonHttpClient(ListeningOn); using (var fileStream = new FileInfo("~/TestExistingDir/upload.html".MapProjectPlatformPath()).OpenRead()) { var request = new FileUpload { CreatedDate = new DateTime(2014, 1, 1, 1, 0, 0) }; var response = client.PostFileWithRequest <FileUploadResponse>( "/fileuploads", fileStream, "upload.html", request); Assert.That(response.CreatedDate, Is.EqualTo(request.CreatedDate).Within(TimeSpan.FromHours(1))); response = client.Put(request); Assert.That(response.CreatedDate, Is.EqualTo(request.CreatedDate).Within(TimeSpan.FromHours(1))); } }
public Task Ban(string serverId, string memberId) => _http.Put(Endpoints.ServerBan(serverId, memberId));