Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass metadata when using HttpCodec.binaryStream #3135

Open
brndt opened this issue Sep 12, 2024 · 4 comments
Open

Pass metadata when using HttpCodec.binaryStream #3135

brndt opened this issue Sep 12, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@brndt
Copy link

brndt commented Sep 12, 2024

What is not easy to do right now?
Right now using HttpCodec.binaryStream doesn't allow you to pass the metadata such as content type and content length (amongst other stuff) to implements method. It would be great to have all the information that you have when working with the plain Binary FormField

@brndt brndt added the maintenance Chore or Maintenance tasks label Sep 12, 2024
@987Nabil
Copy link
Contributor

I think the cleanest way is probably this

  • create a generic version of FormField
  • make at lest two explicit constructors for multipart http codecs
    • text based with support for schema based transformation
    • binary

@987Nabil 987Nabil added enhancement New feature or request and removed maintenance Chore or Maintenance tasks labels Sep 14, 2024
@jdegoes
Copy link
Member

jdegoes commented Sep 14, 2024

Why not just use the headers in the codec? For content length / type?

@987Nabil
Copy link
Contributor

987Nabil commented Sep 15, 2024

@jdegoes this content type and length is part of the body, not the headers. We are talking about multipart

--BOUNDARY
Content-Type: application/json
Content-Disposition: form-data; name="job"

{
  "object":"Contact",
  "contentType":"CSV",
  "operation":"insert"
}

--BOUNDARY
Content-Type: text/csv
Content-Disposition: form-data; name="content"; filename="content"

(Content of your CSV file)
--BOUNDARY—

@jdegoes
Copy link
Member

jdegoes commented Sep 18, 2024

Ah, multi-part.

Can we have direct support for Form?

What I mean by that is, if a user needs to handle form data in a low-level way, accessing content-type and other settings, then perhaps the body type can be Form, and they can implement that, allowing them access to the raw details of the multi-part form.

This would also allow users to write generic code that can handle any multi-part forms.

@brndt Would that satisfy your need?

@987Nabil Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants