abp icon indicating copy to clipboard operation
abp copied to clipboard

IRemoteStreamContent causes other DTO fields to be sent as query parameters instead of request body

Open tson1407 opened this issue 2 months ago • 9 comments

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

tson1407 avatar Oct 31 '25 01:10 tson1407

hi

What is your method info?

Have you added the code below?

Configure<AbpAspNetCoreMvcOptions>(options =>
{
    options.ConventionalControllers.FormBodyBindingIgnoredTypes.Add(typeof(UploadFileDto));
});

maliming avatar Oct 31 '25 02:10 maliming

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:

Image

Here’s my repo if you’d like to check it: https://github.com/tson1407/ABP_Learning

tson1407 avatar Oct 31 '25 16:10 tson1407

Here’s my repo if you’d like to check it: https://github.com/tson1407/ABP_Learning

404

maliming avatar Nov 01 '25 08:11 maliming

"Sorry, I forgot to make it public. You can the previous link again check again.

tson1407 avatar Nov 01 '25 08:11 tson1407

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.

Image

maliming avatar Nov 02 '25 07:11 maliming

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?

tson1407 avatar Nov 02 '25 14:11 tson1407

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

maliming avatar Nov 03 '25 01:11 maliming

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.

tson1407 avatar Nov 03 '25 01:11 tson1407

Please feel free to send the request in Postman. I think it will work for form fields.

maliming avatar Nov 03 '25 01:11 maliming