use of com.dtflys.forest.utils.RequestNameValue in project forest by dromara.
the class ForestRequest method getHeaderNameValueList.
public List<RequestNameValue> getHeaderNameValueList() {
List<RequestNameValue> nameValueList = new ArrayList<RequestNameValue>();
for (Iterator<ForestHeader> iterator = headers.headerIterator(); iterator.hasNext(); ) {
ForestHeader header = iterator.next();
RequestNameValue nameValue = new RequestNameValue(header.getName(), header.getValue(), TARGET_HEADER);
nameValueList.add(nameValue);
}
return nameValueList;
}
use of com.dtflys.forest.utils.RequestNameValue in project forest by dromara.
the class ByteArrayRequestBody method getNameValueList.
@Override
public List<RequestNameValue> getNameValueList(ForestConfiguration configuration) {
String str = new String(byteArray);
List<RequestNameValue> nameValueList = new LinkedList<>();
nameValueList.add(new RequestNameValue(str, MappingParameter.TARGET_BODY));
return nameValueList;
}
use of com.dtflys.forest.utils.RequestNameValue in project forest by dromara.
the class TestForestConfiguration method testDefaultParameters.
@Test
public void testDefaultParameters() {
ForestConfiguration configuration = ForestConfiguration.createConfiguration();
List<RequestNameValue> defaultParameters = new LinkedList<>();
defaultParameters.add(new RequestNameValue("name", "Peter", TARGET_BODY));
defaultParameters.add(new RequestNameValue("age", "15", TARGET_BODY));
configuration.setDefaultParameters(defaultParameters);
assertEquals(defaultParameters, configuration.getDefaultParameters());
}
Aggregations