Commit b1fc1e4a authored by Andre Freyssinet's avatar Andre Freyssinet

Fix JORAM-316: Due to the use of Form parameters for JMS authentication

information, the content-type of the POST shall be fixed.
parent ba0efabc
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2018 - 2019 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Initial developer(s): ScalAgent Distributed Technologies
* Contributor(s):
*/
package rest; package rest;
import java.net.URI; import java.net.URI;
...@@ -50,7 +72,7 @@ public class RestConsumer { ...@@ -50,7 +72,7 @@ public class RestConsumer {
response = client.target(uriCreateCons) response = client.target(uriCreateCons)
.request() .request()
.accept(MediaType.TEXT_PLAIN).post(null); .accept(MediaType.TEXT_PLAIN).post(Entity.entity(null, MediaType.APPLICATION_FORM_URLENCODED));
System.out.println("Create consumer -> " + response.getStatus()); System.out.println("Create consumer -> " + response.getStatus());
if (debug) print(response.getLinks()); if (debug) print(response.getLinks());
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2018 - 2019 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Initial developer(s): ScalAgent Distributed Technologies
* Contributor(s):
*/
package rest; package rest;
import java.net.URI; import java.net.URI;
...@@ -47,11 +69,11 @@ public class RestProducer { ...@@ -47,11 +69,11 @@ public class RestProducer {
// .queryParam("name", "prod1") // .queryParam("name", "prod1")
.getUri(); .getUri();
System.out.println("URI -> " + uriCreateProd);
// Create the producer // Create the producer
response = client.target(uriCreateProd) response = client.target(uriCreateProd)
.request() .request()
.accept(MediaType.TEXT_PLAIN).post(null); .accept(MediaType.TEXT_PLAIN).post(Entity.entity(null, MediaType.APPLICATION_FORM_URLENCODED));
uriCloseProd = response.getLink("close-context").getUri(); uriCloseProd = response.getLink("close-context").getUri();
uriSendNextMsg = response.getLink("send-next-message").getUri(); uriSendNextMsg = response.getLink("send-next-message").getUri();
......
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