Add sendFax overload for mixed files and URLs - #45
Open
piyush15102003 wants to merge 1 commit into
Open
Conversation
sendFax now accepts a File[] and a String[] of document URLs together in one call, so callers no longer have to choose between only files or only a single URL per fax. URL documents are added to the multipart request as a body part with a Content-Location header and no content, matching how the existing single-URL sendFax already tells the InterFAX API a part is a reference rather than inline content.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #25. Adds two sendFax overloads that accept a File[] together with a String[] of document URLs in a single call, so a fax can now be built from a mix of local files and pre-uploaded/HTTP-hosted documents (previously each sendFax overload only accepted one input type).
Files are added to the multipart request exactly as the existing sendFax(faxNumber, File[]) does. Each URL is added as its own body part with no content, a Content-Location header set to the URL, and Content-Length: 0 — the same convention this library's existing single-URL sendFax(faxNumber, String urlOfDoc) already uses at the whole-request level, just applied per multipart part here.
Added testSendMixOfFilesAndUrlsAsFax and testSendMixOfFilesAndUrlsAsFaxWithOptions, following the existing WireMock-based test/fixture style. mvn test passes locally (36/36).