@Override
    public Node toNode() {
        return Node.objectNodeBuilder()
                .withOptionalMember(BODY, getBody().map(Node::from))
                .withOptionalMember(BODY_MEDIA_TYPE, getBodyMediaType().map(Node::from))
                .withOptionalMember(HEADERS,
                        headers.isEmpty() ? Optional.empty() : Optional.of(ObjectNode.fromStringMap(getHeaders())))
                .withOptionalMember(HOST, getHost().map(StringNode::from))
                .withMember(METHOD, getMethod())
                .withOptionalMember(URI, getUri().map(Node::from))
                .withOptionalMember(QUERY_PARAMS,
                        queryParams.isEmpty() ? Optional.empty() : Optional.of(ArrayNode.fromStrings(getQueryParams())))
                .build();
    }
Defines a request to be used by an HttpMalformedRequest test case.
smithy-protocol-test-traits/src/main/java/software/amazon/smithy/protocoltests/traits/HttpMalformedRequestDefinition.java