IRemoteStreamContent causes other DTO fields to be sent as query parameters instead of request body
Is there an existing issue for this?
- [x] I have searched the existing issues
Is your feature request related to a problem? Please describe the problem.
When I use IRemoteStreamContent in my DTO, all other fields are automatically sent as query parameters instead of being part of the request body. I want to include them in the request body instead, but it seems ABP’s auto-generated proxy (or serialization behavior) forces them into the query string.
`` public class UploadFileDto { public string FileName { get; set; } public string Description { get; set; }
public IRemoteStreamContent File { get; set; }
} ``
Describe the solution you'd like
All DTO fields (including metadata) should be in the form body — not split between query and body.
Additional context
ABP Framework version: 9.3.5
hi
What is your method info?
Have you added the code below?
Configure<AbpAspNetCoreMvcOptions>(options =>
{
options.ConventionalControllers.FormBodyBindingIgnoredTypes.Add(typeof(UploadFileDto));
});
Yeah, I’ve fully configured it following the official documentation: https://abp.io/docs/latest/framework/architecture/domain-driven-design/application-services But the issue still isn’t resolved. This is the proxy i gen for Angular:
Here’s my repo if you’d like to check it: https://github.com/tson1407/ABP_Learning
Here’s my repo if you’d like to check it: https://github.com/tson1407/ABP_Learning
404
"Sorry, I forgot to make it public. You can the previous link again check again.
These parameters(exclude IRemoteStreamContent) support all binding sources, and IRemoteStreamContent only supports FromForm source.
Angular proxy can consider passing them to form fields.
You can change the Angular proxy class generated by abp now.
Do we have any backend-side solution for this? I mean, I want to configure everything on the backend so that when I generate the proxy, everything works correctly, Or is there any way to configure the proxy generation process to handle this correctly?
This is not a backend problem, Angular's proxy script generation needs to be improved, you can temporarily change it manually.
https://github.com/tson1407/ABP_Learning/blob/main/KAS.BookStore/angular/src/app/proxy/books/book.service.ts#L56-L73
I see the Swagger documentation for this endpoint shows that the other parameters are also put in the query string, so I think that's the root cause.
Please feel free to send the request in Postman. I think it will work for form fields.