# POST to Remote Web Webservice

**URL:** <https://community.dreamfactory.com/t/post-to-remote-web-webservice/2450>\
**Category:** Server-Side Scripting\
**Created:** [April 1, 2016, 2:56am UTC](https://community.dreamfactory.com/t/post-to-remote-web-webservice/2450 "2016-04-01T02:56:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![andersonmuller](https://avatars.discourse-cdn.com/v4/letter/a/7feea3/32.png) [@andersonmuller](https://community.dreamfactory.com/u/andersonmuller)\
**Post date:** [April 1, 2016, 2:56am UTC](https://community.dreamfactory.com/t/post-to-remote-web-webservice/2450/1 "2016-04-01T02:56:52Z")

</div>

Hi,

My dropwizard server cant parse any json sent by DF(2.1)  
I dont know what is wrong with this call… Sending the same data using Postman, works like a charm.

```
var options = {
  "CURLOPT_HTTPHEADER": [
      "Content-Type: application/json",
      "Cache-Control: no-cache"]
};
var payload = {
    "deviceId": "d7d8ede787de78d7"
};

result = platform.api.post("http://localhost:8080/v1/registry", payload, options);

```

Dropwizard log:

> INFO [2016-03-31 22:13:30,273] org.glassfish.jersey.filter.LoggingFilter: \* Server has received a request on thread dw-109 - POST /v1/registry  
> \> POST [http://localhost:8080/v1/registry](http://localhost:8080/v1/registry)  
> \> Accept: _/_  
> \> Cache-Control: no-cache  
> \> Content-Length: 167  
> \> Content-Type: application/json; boundary=------------------------5f051e39590c891b  
> \> Expect: 100-continue  
> \> Host: localhost:8080  
> --------------------------5f051e39590c891b  
> Content-Disposition: form-data; name=“deviceId”  
> d7d8ede787de78d7  
> --------------------------5f051e39590c891b–  
> DEBUG [2016-03-31 22:13:30,276] io.dropwizard.jersey.jackson.JsonProcessingExceptionMapper: Unable to process JSON  
> ! com.fasterxml.jackson.core.JsonParseException: Unexpected character (‘-’ (code 45)) in numeric value: expected digit (0-9) to follow minus sign, for valid numeric value  
> ! at [Source: org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream@41562f6a; line: 1, column: 3]

Any help will be appreciated.  
Thanks!

---

<div class="post-metadata">

**Author:** ![m\_menon](https://avatars.discourse-cdn.com/v4/letter/m/85f322/32.png) [@m\_menon](https://community.dreamfactory.com/u/m_menon)\
**Post date:** [April 1, 2016, 8:23am UTC](https://community.dreamfactory.com/t/post-to-remote-web-webservice/2450/2 "2016-04-01T08:23:47Z")

</div>

Not sure though but can you try passing the payload this way

```
var payload = { 
"resource": [
     { 
        "deviceId": "d7d8ede787de78d7"
     }
  ] 
};
```

---

<div class="post-metadata">

**Author:** ![andersonmuller](https://avatars.discourse-cdn.com/v4/letter/a/7feea3/32.png) [@andersonmuller](https://community.dreamfactory.com/u/andersonmuller)\
**Post date:** [April 1, 2016, 5:28pm UTC](https://community.dreamfactory.com/t/post-to-remote-web-webservice/2450/3 "2016-04-01T17:28:36Z")

</div>

@m_menon, I tried your suggestion, but didnt work.

The trick in this case is use JSON.stringify(payload)… without resource.
