# POST error or route error?

**URL:** <https://discuss.blues.com/t/post-error-or-route-error/209>\
**Category:** Troubleshooting\
**Created:** [April 16, 2021, 2:57pm UTC](https://discuss.blues.com/t/post-error-or-route-error/209 "2021-04-16T14:57:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Poem](https://avatars.discourse-cdn.com/v4/letter/p/90db22/32.png) [@Poem](https://discuss.blues.com/u/Poem)\
**Post date:** [April 16, 2021, 2:57pm UTC](https://discuss.blues.com/t/post-error-or-route-error/209/1 "2021-04-16T14:57:38Z")

</div>

works in Postman, not from notecard.  
{“req”:“web.post”,“route”:“Polar”,“body”:{“temperature”:“25”}}  
or  
{“req”:“web.post”,“route”:“Polar”,“body”:{“temperature”:25}}  
error is:  
{“err”:“hub request error: invalid character ‘h’ after object key:value pair”}

If I go to a different route, I get a POST (the 400 is what I expect).

> {“req”:“web.post”,“route”:“lp-iLevel”,“body”:{“temperature”:“25”}}  
> {  
> “body”: {  
> “Message”: “Unspecified or invalid Uuid”  
> },  
> “result”: 400  
> }

---

<div class="post-metadata">

**Author:** ![RobLauer](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/roblauer/32/1567_2.png) [@RobLauer](https://discuss.blues.com/u/RobLauer)\
**Post date:** [April 16, 2021, 3:58pm UTC](https://discuss.blues.com/t/post-error-or-route-error/209/2 "2021-04-16T15:58:08Z")

</div>

Hi @Poem,

I’m not sure if this is the issue or not, but your code sample includes smart double-quotes which isn’t valid JSON. (May have just been a copy-paste formatting issue though.) Can you try with regular double quotes or single quotes?

```
{
	"req": "web.post",
	"route": "Polar ",
	"body ": {
		"temperature ": 25
	}
}
```

---

<div class="post-metadata">

**Author:** ![Poem](https://avatars.discourse-cdn.com/v4/letter/p/90db22/32.png) [@Poem](https://discuss.blues.com/u/Poem)\
**Post date:** [April 16, 2021, 4:12pm UTC](https://discuss.blues.com/t/post-error-or-route-error/209/3 "2021-04-16T16:12:40Z")

</div>

Nope:

> {“req”: “web.post”,“route”: “Polar”,"body ": {“temperature”: 25}}  
> {“err”:“hub request error: invalid character ‘h’ after object key:value pair”}

The smart quotes are from the paste into this box. The POST returning the 400 made it round-trip.

---

<div class="post-metadata">

**Author:** ![bsatrom](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/bsatrom/32/3_2.png) [@bsatrom](https://discuss.blues.com/u/bsatrom)\
**Post date:** [April 16, 2021, 5:01pm UTC](https://discuss.blues.com/t/post-error-or-route-error/209/4 "2021-04-16T17:01:04Z")

</div>

Hey @poem, can you confirm that the endpoint you are accessing returns JSON as the content-type? That error from the Notecard looks like a parse error, which would suggest the return content-type is not valid JSON.

---

<div class="post-metadata">

**Author:** ![Poem](https://avatars.discourse-cdn.com/v4/letter/p/90db22/32.png) [@Poem](https://discuss.blues.com/u/Poem)\
**Post date:** [April 16, 2021, 5:09pm UTC](https://discuss.blues.com/t/post-error-or-route-error/209/5 "2021-04-16T17:09:13Z")

</div>

Using Postman to post {“temperature”:25} returns:  
“‘payload’”  
which is valid json  
However, header indicates Content-Type:text/html  
is that the problem?

---

<div class="post-metadata">

**Author:** ![bsatrom](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/bsatrom/32/3_2.png) [@bsatrom](https://discuss.blues.com/u/bsatrom)\
**Post date:** [April 16, 2021, 5:16pm UTC](https://discuss.blues.com/t/post-error-or-route-error/209/6 "2021-04-16T17:16:33Z")

</div>

I believe so, yes. It’s the content-type that matters here. Is this an endpoint you control? Can you change the content-type and try again?

---

<div class="post-metadata">

**Author:** ![Poem](https://avatars.discourse-cdn.com/v4/letter/p/90db22/32.png) [@Poem](https://discuss.blues.com/u/Poem)\
**Post date:** [April 16, 2021, 5:17pm UTC](https://discuss.blues.com/t/post-error-or-route-error/209/7 "2021-04-16T17:17:23Z")

</div>

Yep… looks like a server problem. If I post as json rather than text I throw an error. Thanks
