spring-boot

How to make a JSON POST request from Java client to Python FastAPI server?

How to make a JSON POST request from Java client to Python FastAPI server? Question: I send a post request from a java springboot application like this: String requestBody = gson.toJson(sbert); System.out.println(requestBody); // If I print this, and use this in postman it works! HttpRequest add_request = HttpRequest.newBuilder() .uri(URI.create("http://localhost:4557/sbert_similarity")) .POST(HttpRequest.BodyPublishers.ofString(requestBody)) .header("Content-Type", "application/json") .build(); HttpResponse<String> response …

Total answers: 1

Spring Batch ScriptItemProcessor

Spring Batch ScriptItemProcessor Question: I want to use a web scraping python script in my batch program but I cannot find any examples in the web for this. Hence, it’s possible to use python scripts with the ScriptItemProcessor? Here’s my simple code to test this: @Bean public ScriptItemProcessor<Company,Company> scriptItemProcessor() { return new ScriptItemProcessorBuilder<Company,Company>().language("python").scriptSource("print(‘hello’)").build(); } UPDATE …

Total answers: 1