Question: Multipart form-data with Refit
See original GitHub issueHi,
I have a dotnet core web api endpoint that takes a strongly typed object as argument
public class FileUploadArgs
{
public int Id { get; set; }
public string Email { get; set; }
public IFormFileCollection Files { get; set; }
}
Endpoint signature:
[HttpPost, Route("upload")]
public async Task<IActionResult> UploadFile([FromForm] FileUploadArgs args)
I call this method via HTTPIE on shell as
$ http -f POST localhost:5000/api/v3/file/upload Id='123456' Email='test@test.com' 'Files'@/mnt/c/apiloadtest/2124545.pdf x-api-key:'{my-api-key}'
I want to write this endpoint in Refit interface in another app that will send files to this endpoint along with other form data.
I’m not sure how this can be be written in Refit. Any help would be appreciated!
Thanks!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:19
- Comments:8
Top Results From Across the Web
c# - Multipart Content with refit
It's an old question, but maybe it could help others. I wasn't able to use StreamPart either since the file size received on...
Read more >How can I compose a multipart/form-data request?
I'm trying to integrate Kraken.io into our org so I can have Salesforce queue up image optimization jobs that our employees upload. Kraken.io ......
Read more >Multipart Form Post in C# - Brian Grinstead
I first tried using the WebClient UploadFile method, but it didn't fit my needs because I wanted to upload form values (id, filename,...
Read more >Question: How to upload a file using HTTP POST Form-Data?
I am looking to upload multipart for data, including a file, with an HTTP post. When implementing your example I do receive errors...
Read more >C# – Multipart Content with refit
I am using multipart with Refit. I try to upload profile picture for my service the code generated from postman is looking like...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I successfully fulfilled the requirement
Mm-hmm. Ooooooo the baby is already crying