MuleSoft
MCD-LEVEL-1 · Question #117
A flow contains an HTTP Listener as the event source. What is the DataWeave expression to log the Content-Type header using a Logger component?
The correct answer is A. #["Content-Type: " ++ attributes.headers.'content-type']. not with + sign which makes option 2 and 3 wrong 2) hearders can be accessed with attributes. headers and not with only headers which makes option 4 incorrect
Building Integration Applications with Mule 4
Question
A flow contains an HTTP Listener as the event source. What is the DataWeave expression to log the Content-Type header using a Logger component?
Options
- A#["Content-Type: " ++ attributes.headers.'content-type']
- B#["Content-Type: " + headers.'content-type']
- C#["Content-Type: " + attributes.headers.'content-type']
- D#["Content-Type: " ++ headers.'content-type']
How the community answered
(18 responses)- A78% (14)
- B6% (1)
- C11% (2)
- D6% (1)
Explanation
not with + sign which makes option 2 and 3 wrong 2) hearders can be accessed with attributes. headers and not with only headers which makes option 4 incorrect
Topics
#DataWeave#HTTP attributes#headers#string concatenation
Community Discussion
No community discussion yet for this question.