Setting "Content-Type: text/plain" in app gateway call?

Hello!

I have a few Ruuvi tags and so far use the Ruuvi station Android app to read their measurements.

I would like to use the gateway feature of the app to periodically send measurements to my home automation system, which can receive data through HTTP POST requests.

Unfortunately, the REST API of the home automation requires POST requests to have “Content-Type: text/plain” set in the request header. Requests with “application/json” are rejected with “HTTP Error 415 Unsupported Media Type”.

My question: Is is possible to change the content-type header that the app sends with the gateway call?

Thank you very much!

Hey! Yes, it is possible. But I’m not sure how it may affect other users, it may broke someone’s backend.

Apart from header Content-Type do you think you’ll be able to parse current format from app into compatible format for your home automation?

Hello! Wonderful!

Yes, I think parsing should not be a problem. I will be happy if I can get the whole JSON as shown in the example Using Ruuvi Station as a Gateway - docs. So how can I do that?

Thank you!

Try to download releaseAPK from here: Data forwarding feature send data as plain/text · ruuvi/com.ruuvi.station@9183a11 · GitHub

If it’s not available I can email it to you.

These changes were made in separate branch and they won’t be in Google Play version. So no automatic updates or fixes are in plans.

Thank you! The changed app works perfectly! I’m receiving lots of data now :slight_smile:
I will configure the parsing later today.