var client = new JsonServiceClient("http://example.com"); var request = new UploadRequest { File = new FileInfo("path/to/file"), UserId = 123 }; var response = client.PostFileWithRequest("upload", request);
var client = new JsonServiceClient("http://example.com"); var file = new FileInfo("path/to/file"); var response = client.PostFileWithRequestIn this example, only the file is uploaded to the URL "http://example.com/upload", without any additional parameters. The response object contains any data returned by the server. Both examples use the PostFileWithRequest method to upload a file. The first example sends the file along with additional parameters in the form of an object, while the second example only sends the file. The method returns the response data from the server, deserialized into an object of the specified type.("upload", file);