"Now on to the next hurdle: POST request. Based on my tests here, looks like Crestron only sends POST messages with Content-Type: application/x-www-form-urlencoded.
It seems to be ignoring the fact that I am trying to send data as?Content-Type:?application/json"
You can specify the content type in request header, example code:
On Sunday, February 13, 2022, 06:48:21 p.m. PST, fabiodaubermann <fdaubermann@...> wrote:
Hi Troy and MasterHe,
?
Good points indeed. What you said makes?sense:? a GET request should have no body (if we are to follow the standard).
One of the things that threw me off is the inconsistency on the crestron libraries between http and https. Got me into a rabbit hole.
?
The Http library does add a content-length on a GET request, even though it shouldn't (its a bug! not a feature!)
The Https library does not add a content-length on a GET (It's a feature! Not a bug!) and will even freeze if you try to add one (ok so this one might be a bug! not a feature.)
?
Now on to the next hurdle: POST request. Based on my tests here, looks like Crestron only sends POST messages with Content-Type: application/x-www-form-urlencoded.
It seems to be ignoring the fact that I am trying to send data as?Content-Type:?application/json
I'm wondering if I'm missing something obvious.
?
I updated the sample program (on github)? in case you would like to see what I am referring to.