File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
src/main/java/net/b07z/sepia/sdk/services/uid1007 Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -164,7 +164,10 @@ public ServiceResult getResult(NluResult nluResult) {
164164 //Example HTTP call e.g. to a web API, your PythonBridge or any other micro-service with HTTP interface:
165165 /*
166166 try{
167- JSONObject response = Connectors.apacheHttpGETjson("http://localhost:20731/my-service/");
167+ String qUrlParam = "?q=" + URLEncoder.encode(qRaw, "UTF-8");
168+ JSONObject response = Connectors.apacheHttpGETjson(
169+ "http://localhost:20731/my-service/" + qUrlParam
170+ );
168171 if (response != null && response.containsKey("answer")){
169172 questionResponse = JSON.getString(response, "answer");
170173 }
Original file line number Diff line number Diff line change @@ -165,8 +165,12 @@ public ServiceResult getResult(NluResult nluResult) {
165165 //Example call to another PythonBridge endpoint (define yourself)
166166 /*
167167 String myReply = "";
168+ String myQuestion = "my question";
168169 try{
169- JSONObject response = Connectors.apacheHttpGETjson("http://localhost:20731/my-service/");
170+ String qUrlParam = "?q=" + URLEncoder.encode(myQuestion, "UTF-8");
171+ JSONObject response = Connectors.apacheHttpGETjson(
172+ "http://localhost:20731/my-service/" + qUrlParam
173+ );
170174 if (response != null && response.containsKey("myReply")){
171175 myReply = JSON.getString(response, "myReply");
172176 ...
You can’t perform that action at this time.
0 commit comments