-2
I’m doing the requisition this way, but I’m not succeeding , someone who’s been through it?
private static String vwsApiUrl = "http://vws.veloxtickets.com:82/wscinema.ws/Get_Cinema_Programacao";
String url = "'{\"AUTENTICACAO\":{\"USUARIO\":\"SONAE\",\"SENHA\":\"senha\"},\"GETPROG\":{\"DATAINI\":\"2018-07-05\",\"DATAFIN\":\"2018-07-08\",\"CODPRACA\":\"PLZ\"}}'";
Disposable webClient = WebClient.create(vwsApiUrl )
.method ( HttpMethod.GET)
.uri ( vwsApiUrl + url)
.contentType ( MediaType.APPLICATION_JSON_UTF8)
.accept ( MediaType.APPLICATION_JSON_UTF8 )
.exchange ()
.flatMap ( clientResponse -> clientResponse.bodyToMono ( String.class ) ).subscribe ( System.out::println );
This json was another attempt , but I passed tbm the url ,and returns an error :
Exception in thread "restartedMain" java.lang.reflect.Invocationtargetexception Caused by: java.lang.Illegalargumentexception: Not enough variable values available to expand '"DATAINI"' at org.springframework.web.util.Uricomponents$Varargstemplatevariables.getValue(Uricomponents.java:352) at org.springframework.web.util.Uricomponents.expandUriComponent(Uricomponents.java:252)
Enter a little more context, so the reader can identify better. What do you search for? What’s the ? How ? what do you use ?
– Otávio Reis Perkles
.uri ( vwsApiUrl + json )- are you sure this is what you wanted? Note that your JSON is in the variableurlthat you don’t use anywhere, while the variablejson, Only with that code can’t tell what it is because it’s not set anywhere. Also I think that concatenating a JSON into the URL like this is something strange to say the least.– Victor Stafusa
Are you getting some error doing this?
– Dherik