Skip to content

Add sendFax overload for mixed files and URLs - #45

Open
piyush15102003 wants to merge 1 commit into
interfax:masterfrom
piyush15102003:sendfax-mixed-files-and-urls
Open

Add sendFax overload for mixed files and URLs#45
piyush15102003 wants to merge 1 commit into
interfax:masterfrom
piyush15102003:sendfax-mixed-files-and-urls

Conversation

@piyush15102003

Copy link
Copy Markdown

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).

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ability to send a mix of files and URLs?

1 participant