HTTP/1.1 415 Unsupported Media Type?


#1

I am following the TI CC3220 Guide for Murano. http://docs.exosite.com/tutorials/hvac-tutorial/cc3220/. I am at the part where I enter a curl command with my Product ID. But I am getting this error below. How do I make the curl command work?

C:\curl-7.55.1-win64-mingw\bin>curl -i https://s47dxcxlo07s00000.m2.exosite.io/provision/activate -H Content-Type: application/x-www-form-urlencoded; charset=utf-8 -d id=000001
HTTP/1.1 415 Unsupported Media Type
content-length: 37
date: Mon, 11 Sep 2017 12:22:37 GMT
server: Murano

HTTP/1.1 415 Unsupported Media Type
curl: (6) Could not resolve host: application
curl: (6) Could not resolve host: charset=utf-8

Regards,
Markel


#2

It looks like a shell quoting problem. Try putting single quotes around the content type info.

Like this:
curl -i ‘https://s47dxcxlo07s00000.m2.exosite.io/provision/activate’ -H ‘Content-Type: application/x-www-form-urlencoded; charset=utf-8’ -d ‘id=000001’


#3

I tried that the first time and I got this error below.

C:\curl-7.55.1-win64-mingw\bin>curl -i ‘https://s47dxcxlo07s00000.m2.exosite.io/provision/activate’ -H ‘Content-Type: application/x-www-form-urlencoded; charset=utf-8’ -d ‘id=000001’
curl: (1) Protocol “'https” not supported or disabled in libcurl
curl: (6) Could not resolve host: application
curl: (6) Could not resolve host: charset=utf-8’


#4

Well, from that, it looks like your version of curl does not have TSL built in. Check by running curl --version

Here is what mine shows:

curl --version
curl 7.54.1 (x86_64-pc-win32) libcurl/7.54.1 OpenSSL/1.1.0f zlib/1.2.11 WinIDN libssh2/1.8.0 nghttp2/1.23.1
Release-Date: 2017-06-14
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile SSPI Kerberos SPNEGO NTLM SSL libz TLS-SRP HTTP2 HTTPS-proxy

Does yours also have the “OpenSSL” bit?


#5

This is my curl version below.

C:\curl-7.55.1-win64-mingw\bin>curl --version
curl 7.55.1 (x86_64-pc-win32) libcurl/7.55.1 OpenSSL/1.1.0f zlib/1.2.11 WinIDN libssh2/1.8.0 nghttp2/1.25.0
Release-Date: 2017-08-14
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile SSPI Kerberos SPNEGO NTLM SSL libz TLS-SRP HTTP2 HTTPS-proxy


#6

I read in stackoverflow post that I should use double quote instead. So, I try the double quote and this is what I got below.

C:\curl-7.55.1-win64-mingw\bin>curl -i “http://s47dxcxlo07s00000.m2.exosite.io/provision/activate” -H “Content-Type: application/x-www-form-urlencoded; charset=utf-8” -d "id=000001"
curl: (7) Failed to connect to s47dxcxlo07s00000.m2.exosite.io port 80: Connection refused


#7

@mtrobregado

curl -i “http://s47dxcxlo07s00000.m2.exosite.io/provision/activate” -H “Content-Type: application/x-www-form-urlencoded; charset=utf-8” -d “id=000001”

Murano insists by default that you talk to it via HTTPS on port 443. I think you just need to change back to HTTPS. Try:

curl -i "https://s47dxcxlo07s00000.m2.exosite.io/provision/activate" -H "Content-Type: application/x-www-form-urlencoded; charset=utf-8" -d "id=000001"

Then we’ll really get to the root of the SSL problem.

-Martin


#8

That worked thanks.

Tomorrow I learn how to make the Murano CLI work. Seems the guide lacking steps for Windows 10.


#9

I agree, that guide is really short right now. This is a symptom of our hesitancy to build the tutorial on the beta device manager.

But we still can do better.

Thanks for the feedback,
-Martin