{"action":"opened","issue":{"url":"https://api.github.com/repos/restsharp/RestSharp/issues/1168","repository_url":"https://api.github.com/repos/restsharp/RestSharp","labels_url":"https://api.github.com/repos/restsharp/RestSharp/issues/1168/labels{/name}","comments_url":"https://api.github.com/repos/restsharp/RestSharp/issues/1168/comments","events_url":"https://api.github.com/repos/restsharp/RestSharp/issues/1168/events","html_url":"https://github.com/restsharp/RestSharp/issues/1168","id":360414541,"node_id":"MDU6SXNzdWUzNjA0MTQ1NDE=","number":1168,"title":"How to send multipart/form-data body request without uploading a file?","user":{"login":"ChrisTheEngineer","id":10354556,"node_id":"MDQ6VXNlcjEwMzU0NTU2","avatar_url":"https://avatars1.githubusercontent.com/u/10354556?v=4","gravatar_id":"","url":"https://api.github.com/users/ChrisTheEngineer","html_url":"https://github.com/ChrisTheEngineer","followers_url":"https://api.github.com/users/ChrisTheEngineer/followers","following_url":"https://api.github.com/users/ChrisTheEngineer/following{/other_user}","gists_url":"https://api.github.com/users/ChrisTheEngineer/gists{/gist_id}","starred_url":"https://api.github.com/users/ChrisTheEngineer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChrisTheEngineer/subscriptions","organizations_url":"https://api.github.com/users/ChrisTheEngineer/orgs","repos_url":"https://api.github.com/users/ChrisTheEngineer/repos","events_url":"https://api.github.com/users/ChrisTheEngineer/events{/privacy}","received_events_url":"https://api.github.com/users/ChrisTheEngineer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-14T18:46:58Z","updated_at":"2018-09-14T18:46:58Z","closed_at":null,"author_association":"NONE","body":"Hello,\r\n\r\nI am unable to send a rest request using RestSharp where the body is encoded as multipart/form-data. There seems to be an issue, how would you do this via RestSharp? Below is my current code:\r\n\r\n```\r\nstring url = NDRoutes.Document;\r\n            Boolean useXml = false;\r\n\r\n            NewPaperDocumentRequest paperDocumentEntity = FillPaperDocumentRequest(createPaperDocumentRequest);\r\n            RestRequest rr = _communicationsService.FormRequest(Method.POST, url, useXml);\r\n            \r\n            rr.AddHeader(\"Content-Type\", \"multipart/form-data\");\r\n            string body = JsonConvert.SerializeObject(paperDocumentEntity);\r\n            rr.RequestFormat = DataFormat.Json;\r\n            rr.AlwaysMultipartFormData = true;\r\n            \r\n            rr.AddParameter(\"action\", paperDocumentEntity.Action, \"multipart/form-data\", ParameterType.GetOrPost);\r\n            rr.AddParameter(\"name\", paperDocumentEntity.Name, \"multipart/form-data\", ParameterType.GetOrPost);\r\n            rr.AddParameter(\"extension\", paperDocumentEntity.Extension, \"multipart/form-data\", ParameterType.GetOrPost);\r\n            rr.AddParameter(\"cabinet\", paperDocumentEntity.Cabinet, \"multipart/form-data\", ParameterType.GetOrPost);\r\n            rr.AddParameter(\"failOnError\", paperDocumentEntity.FailOnError, \"multipart/form-data\", ParameterType.GetOrPost);\r\n            rr.AddParameter(\"return\", paperDocumentEntity.Return, \"multipart/form-data\", ParameterType.GetOrPost);\r\n            rr.AddBody(body);\r\n\r\n            _communicationsService.ExecuteRequest(rr);\r\n```"}}
{"actor":{"display_login":"ChrisTheEngineer"}}