HTTP 411 error in API setroomthermpoint
Since some hours, API setroomthermpoint is returning this error: "HTTP Error 411. The request must be chunked or have a content length"
I have a home made app that automatically execute same steps every day and today is failing with this error without any changes in the way to invoke this API.
My home app execute this invoke (that is according with the documentation) NOTE that home_id and room_id has been hide by me for publish this post:
curl -X POST 'https://api.netatmo.com/api/setroomthermpoint?access_token=xxxxxxx&home_id=xxxx&room_id=xxxx&mode=off' -H 'accept: application/json'
Response for this invoke is:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Length Required</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Length Required</h2>
<hr><p>HTTP Error 411. The request must be chunked or have a content length.</p>
</BODY></HTML>
If I introduce a content length for header, i receive other error:
curl -X POST "https://api.netatmo.com/api/setroomthermpoint?access_token=xxxxxxx&home_id=xxxxxx&room_id=xxxx&mode=home" -H "Content-Length: 6 accept: application/json"
Response:
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<meta content='text/html; charset=utf-8' http-equiv='content-type' />
<style type='text/css'>
body {
font-family: Arial;
margin-left: 40px;
}
img {
border: 0 none;
}
#content {
margin-left: auto;
margin-right: auto
}
#message h1 {
font-size: 24px;
font-weight: normal;
color: #000000;
margin: 34px 0px 0px 0px
}
#message h2 {
font-size: 20px;
font-weight: normal;
color: #000000;
margin: 34px 0px 0px 0px
}
#message p {
font-size: 16px;
color: #000000;
margin: 8px 0px 0px 0px
}
#message hr {
margin: 15px 0px
}
#errorref {
font-size: 11px;
color: #737373;
margin-top: 41px
}
</style>
<title>Service unavailable</title>
</head>
<body>
<div id='content'>
<div id='message'>
<h2>Our services aren't available right now.</h2>
<p>We're working to restore all services as soon as possible. Please check back soon.</p> </div>
<div id='errorref'>
<span> </span>
</div>
</div>
</body>
</html>
Are someone expecting the same behaviour? Is there in this forum someone from Netatmo in order to review if this api endpoint is working propertly?
Regards!
Comments
4 comments
Hello,
I don't reproduce on my side and I didn't get for now any similar feedback. We pushed a fix this morning to re-allow using the access_token as query parameter (it was a bug following an update yesterday)
Can you re-try with the access_token as URL parameter, or try to put the value in the header of the call ? (-H "Authorization: Bearer access_token_value")
Have a good day,
Leslie - Community Manager
Hi Leslie,
Problem persist:
Introducing access_token as URL parameter (hidding the real values access_token and home_id and room_id):
curl -X POST 'https://api.netatmo.com/api/setroomthermpoint?access_token=xxx&home_id=xxx&room_id=xxx&mode=off' -H 'Authorization: Bearer access_token_value'
Length Required
Length Required
HTTP Error 411. The request must be chunked or have a content length.
Using the value in the header of the call (hidding the real values access_token and home_id and room_id)
curl -X POST 'https://api.netatmo.com/api/setroomthermpoint?home_id=xxx&room_id=xxx&mode=off' -H 'Authorization: Bearer xxx'
Length Required
Length Required
HTTP Error 411. The request must be chunked or have a content length.
Any idea about the reason?
Hi again Leslie,
I tried to invoke the api from Google Chrome browser, using access_token as parameter on the URL (same invoke that I executed with curl) and works fine (return success).
So the problem happen only with curl.
I could solve the problem.
Adding -d "" causes CURL to send a Content-Length: 0 header, which resolves the problem.
I don't know why before you pushed the fix for the bug it was not neccesary force curl to content lenght to 0 (but now it is necessary)
Anyway this change in my side solved the problem.
Please sign in to leave a comment.