diff options
Diffstat (limited to 'src/executor.rs')
-rw-r--r-- | src/executor.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/executor.rs b/src/executor.rs index d330419..b5f8e96 100644 --- a/src/executor.rs +++ b/src/executor.rs @@ -55,7 +55,7 @@ impl Executor { Executor { context } } - pub fn execute(&mut self, bfile: BarbFile) -> Result<ureq::Response, String> { + pub fn execute(&mut self, bfile: BarbFile, print_headers: bool) -> Result<ureq::Response, String> { let mut req = ureq::request( bfile.method_as_string().as_str(), self.context.substitute(&bfile.url()).as_str(), @@ -66,11 +66,13 @@ impl Executor { header.name(), self.context.substitute(header.value()).as_str(), ); - println!( - "{} {}", - header.name(), - self.context.substitute(header.value()) - ); + if print_headers { + println!( + "{} {}", + header.name(), + self.context.substitute(header.value()) + ); + } } match bfile.method().takes_body() { |