Configure WebService

0

I'm having trouble setting up a POST method, I'm implementing integration with the Gerencianet payment platform, their support returned me the following message in a call:

  

Dear, please try to evaluate the header of your query file to the token. Because we do not know your implementation files, apart from the fact that we can not interfere because of security issues, I will try to assist you in finding an appropriate solution.

I believe the error refers to the call not including the "Content-Type: application / json" statement. link

HTTP 415 means that the server does not understand the media format of the request. On your controller you are specifying that you accept JSON, but you did not say whether the request indicated that the body is in that format. Just because you put the data in JSON format does not mean that the server will recognize it, you have to indicate it in the Content-Type header.

/**
 * Método que recebe o Token do Gerencianet via POST
 * 
 * Então é passado para o método que realiza a consulta via Token
 * e atualiza o Objeto no BD
 * */
@POST
@Path("/RecebeToken")
@Consumes(MediaType.APPLICATION_JSON)
public void recebeToken(String token){
    System.out.println("Token Recebido: "+token);
    //CheckOut.consultar(token);

}
    
asked by anonymous 01.02.2017 / 14:22

0 answers