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

Update HttpSender.Request.Builder to support multipart/form-data request bodies with multiple parts #5044

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bryceatmoderne
Copy link
Contributor

@bryceatmoderne bryceatmoderne commented Feb 14, 2025

What's changed?

Update HttpSender.Request.Builder to support building multipart/form-data request bodies with multiple parts.

What's your motivation?

This functionality is required for CLI feature development.

Anything in particular you'd like reviewers to focus on?

No.

Anyone you would like to review specifically?

@pstreef

Have you considered any alternatives or workarounds?

No.

Any additional context

No.

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

@bryceatmoderne bryceatmoderne self-assigned this Feb 14, 2025
@bryceatmoderne bryceatmoderne changed the title Update HttpSender.Request.Builder to support multipart/form-data request bodies with multiple parts Update HttpSender.Request.Builder to support multipart/form-data request bodies with multiple parts Feb 14, 2025
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some suggestions could not be made:

  • rewrite-hcl/src/main/java/org/openrewrite/hcl/format/TabsAndIndentsVisitor.java
    • lines 255-256
  • rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/HclPrinter.java
    • lines 363-364
  • rewrite-java/src/main/java/org/openrewrite/java/internal/template/AnnotationTemplateGenerator.java
    • lines 158-159
  • rewrite-java/src/main/java/org/openrewrite/java/internal/template/BlockStatementTemplateGenerator.java
    • lines 281-282
    • lines 669-669
  • rewrite-java/src/main/java/org/openrewrite/java/search/FindEmptyClasses.java
    • lines 57-57
  • rewrite-xml/src/main/java/org/openrewrite/xml/internal/XmlPrinter.java
    • lines 106-106
  • rewrite-yaml/src/main/java/org/openrewrite/yaml/cleanup/RemoveUnusedVisitor.java
    • lines 76-76

@@ -129,11 +127,13 @@ public String toString() {

@SuppressWarnings("UnusedReturnValue")
public static class Builder {
private static final String APPLICATION_JSON = "application/json";
private static final String TEXT_PLAIN = "text/plain";
public static final String APPLICATION_JSON = "application/json";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is exposed for tests I think? Can you make these package private instead?

/**
* Adds a part to a multipart/form-data request body.
*
* @param type The "Content-Type" of the part.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe rename it to contentType?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Ready to Review
Development

Successfully merging this pull request may close these issues.

2 participants