Forgive my ignorance - a jr developer here. I'm trying to make a PUT call to a client API. In the documentation it shows the request headers have an object in them. I thought headers could only have a String value. How can I add an object to my HttpHeaders object?
Request Model from API Documentation
requestHeader {
"headerA": "valueA",
"headerB": {
"headerB1": "valueB1",
"headerB2": "valueB2"
},
"headerC": "valueC"
}
requestBody {
"object": {
"variable1": 12345,
"variable2": 54321
},
"sameNums": false }
I'm using HttpHeaders from package org.springframework.http - the set() and add() methods take Strings as parameters. How can I add an object as a header value?