Tag: playframework 2.0

HttpClient上传MultipartFormData来玩2框架

我在使用RestSharp客户端的Windows Phone 8项目中有以下代码: public async Task DoMultiPartPostRequest(String ext, JSonWriter jsonObject, ObservableCollection attachments) { var client = new RestClient(DefaultUri); // client.Authenticator = new HttpBasicAuthenticator(username, password); var request = new RestRequest(ext, Method.POST); request.RequestFormat = DataFormat.Json; request.AddParameter(“json”, jsonObject.ToString(), ParameterType.GetOrPost); // add files to upload foreach (var a in attachments) request.AddFile(“attachment”, a.FileBody, “attachment.file”, a.ContType); var content = await client.GetResponseAsync(request); […]