Adding a test message in the Elasticsearch database by running AddMessageToElasticSearch.ps1 gives header content type issue

install
setup

#1

Power shell Script : AddMessageToElasticSearch.ps1

Studio/Robot version: 2018

Elastic search version: 6.0

Current behavior: Test is not successful due to unsupported content type

Elastic search 6.0 is installed and before creating indexes in Kibana, a test script to send message to elastic search database is executed. Test is not successful due to unsupported content type. Should we downgrade the version of Elastic search to 5.0 just for testing failure?


#2

Hi Sumesh,

In the last line of the script, add -ContentType ‘application/json’.

So the whole line will look like this:
Invoke-WebRequest -Uri $WebRequestPath -ContentType 'application/json' -Method POST -Body (ConvertTo-Json $messageBody)

Please try this and let me know if it works for you.


#3

Hello Ovi,

It worked. Thanks

Sumesh


#4

That’s great!