I am trying to communicate with an external web service (Elastic search API) using java, but without using any elasticsearch library, so I created a query class that match the request that we gonna send to elsaticsearch API :
GET /_search
{
"query": {
"multi_match" : {
"query": "this is a test",
"fields": [ "subject", "message" ]
}
}
}
here is the equivalant class :
@Data
class QueryRequest{
private Query query;
}
@Data
class Query{
private Match multi_match;
}
@Data
class Match{
private String query;
private Lis<String> fields;
}
to fetch this API using curl we need to write this request :
curl --location --request GET <host> --header 'Content-Type : application/json' --data-row '{ "query": {
"multi_match" : {
"query": "this is a test",
"fields": [ "subject", "message" ]
}
}}'
my question is how I can send this kind of request using feign client