Commit 7c896ce1 authored by j.hoerdt's avatar j.hoerdt
Browse files

fix compile errors

parent 8bc05375
......@@ -5,15 +5,10 @@ import sensor2graph.georev.*;
import org.neo4j.driver.*;
import org.neo4j.driver.Record;
import okhttp3.MediaType;
import okhttp3.*;
import com.google.gson.*;
import java.net.*;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;
import java.net.http.HttpResponse.BodyHandlers;
import java.time.Duration;
import java.util.*;
import java.util.function.*;
import java.util.logging.*;
......@@ -74,7 +69,7 @@ class Sensor {
Request request = new Request.Builder()
.url(Main.pid_registry_uri + target_uri)
.method(RequestBody.create(MediaType.parse("application/json", body.toString())))
.method(method, RequestBody.create(MediaType.parse("application/json"), body.toString()))
.header("Accept", "application/json")
.header("Content-Type", "application/json")
.header("Authorization", "Handle clientCert=\"true\"")
......@@ -84,14 +79,13 @@ class Sensor {
System.out.println(response.body().string() + response.code());
Main.glogger.fine("status: " + response.code());
Main.glogger.fine("resp: " + response.body().string());
}
if (response.code() / 100 != 2) {
throw new Exception("request to pid registry failed with status code " + response.statusCode() + ", reponse: " + response.body());
if (response.code() / 100 != 2) {
throw new Exception("request to pid registry failed with status code " + response.code() + ", reponse: " + response.body().string());
}
return response.body().string();
}
return response.body();
}
private void add_attribute(JsonArray body, String registered_type, String parsed_data) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment