Skip to content

Commit 23138fc

Browse files
committed
Changed type of the data parameter from String[] to String in order to prevent incorrect parsing with left over quotation marks
1 parent c374a17 commit 23138fc

File tree

3 files changed

+495
-484
lines changed

3 files changed

+495
-484
lines changed

src/main/java/multichain/command/builders/QueryBuilderCommon.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import java.io.IOException;
1111
import java.io.UnsupportedEncodingException;
12+
import java.nio.charset.StandardCharsets;
1213
import java.util.ArrayList;
1314
import java.util.Arrays;
1415
import java.util.HashMap;
@@ -174,6 +175,8 @@ protected Object execute(CommandEnum command, Object... parameters) throws Multi
174175
// Generate the entity and initialize request
175176
StringEntity rpcEntity = prepareRpcEntity(entityValues);
176177
httppost.setEntity(rpcEntity);
178+
179+
System.out.println(new String(httppost.getEntity().getContent().readAllBytes(), StandardCharsets.UTF_8));
177180
// Execute the request and get the answer
178181
return executeRequest();
179182

@@ -219,7 +222,7 @@ private Object executeRequest() throws IOException, ClientProtocolException, Mul
219222

220223
private Map<String, Object> prepareMap(CommandEnum command, Object... parameters) {
221224
Map<String, Object> entityValues = new HashMap<String, Object>();
222-
entityValues.put("id", UUID.randomUUID().toString());
225+
entityValues.put("id", UUID.randomUUID().toString( ));
223226
entityValues.put("method", command.toString().toLowerCase());
224227
List<Object> paramList = new ArrayList<Object>(Arrays.asList(parameters));
225228
entityValues.put("params", paramList);

0 commit comments

Comments
 (0)