Skip to content

Commit

Permalink
feat(HyperRequest): Add asBinary helper method.
Browse files Browse the repository at this point in the history
  • Loading branch information
elpete committed Feb 2, 2024
1 parent daf90bd commit 966c9ae
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions models/HyperRequest.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,17 @@ component accessors="true" {
return this;
}

/**
* A convenience method to set the body format and Content-Type to xml.
*
* @returns The HyperRequest instance.
*/
function asBinary() {
setBodyFormat( "binary" );
setContentType( "application/octet-stream" );
return this;
}

/**
* Attaches a file to the Hyper request.
* Also sets the Content-Type as `multipart/form-data`.
Expand Down

0 comments on commit 966c9ae

Please sign in to comment.