Commit 7188f123 authored by Björn Butzin's avatar Björn Butzin
Browse files

reverted httpasyncclient dependency to version 4.0-beta3 and updated proxy mapper to fix issue #3)

parent fb29fea6
......@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.ws4d.jcoap</groupId>
<artifactId>jcoap-proxy</artifactId>
<version>0.0.1</version>
<version>0.0.2</version>
<name>jCoAP Proxy</name>
<build>
<sourceDirectory>src</sourceDirectory>
......@@ -67,17 +67,17 @@
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpasyncclient</artifactId>
<version>4.1.2</version>
<version>4.0-beta3</version>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.3</version>
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.6.2</version>
<version>2.10.0</version>
</dependency>
<dependency>
<groupId>org.ws4d.jcoap</groupId>
......@@ -87,7 +87,7 @@
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>2.10.2.2.21</version>
<version>2.10.4</version>
</dependency>
</dependencies>
<url>https://gitlab.amd.e-technik.uni-rostock.de/ws4d/jcoap</url>
......
......@@ -91,10 +91,8 @@ import org.apache.http.util.EncodingUtils;
* @see ConsumingNHttpEntity
* @see ProducingNHttpEntity
*
* @since 4.0
*/
/**
* @since 4.0
*
* @author Christian Lerche <christian.lerche@uni-rostock.de>
* @author Andy Seidel <andy.seidel@uni-rostock.de>
*/
......
......@@ -422,30 +422,29 @@ public class ProxyMapper {
CoapRequest request = context.getInCoapRequest();
CoapRequestCode code = request.getRequestCode();
// TODO:translate header options from coap-request to http-request
NStringEntity entity;
entity = new NStringEntity(new String(request.getPayload()));
NStringEntity entity=null;
//entity = new NStringEntity(new String(request.getPayload()));
switch (code) {
case GET:
httpRequest = new HttpGet(context.getUri().toString());
break;
case PUT:
httpRequest = new HttpPut(context.getUri().toString());
entity = new NStringEntity(new String(request.getPayload()));
((HttpPut) httpRequest).setEntity(entity);
break;
case POST:
httpRequest = new HttpPost(context.getUri().toString());
entity = new NStringEntity(new String(request.getPayload()));
((HttpPost) httpRequest).setEntity(entity);
break;
case DELETE:
httpRequest = new HttpDelete(context.getUri().toString());
break;
default:
entity.close();
throw new IllegalStateException("unknown request code");
}
context.setOutHttpRequest(httpRequest);
entity.close();
}
public static void transResponseCoapToCoap(ProxyMessageContext context) {
......
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