Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-10

TExtJsJSonDataFormatter set ContentType

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Leonardo M. Ramé

I found TExtJsJsonDataFormatter has a protected method GetDataContentType that returns 'text/html'.

How can I change that value without inheriting from this class? I want to return 'text/json;charset=iso-8859-1'.

Thanks in advance,

Reply by email

Michael Van Canneyt
to Leonardo M. Ramé
Leonardo M. Ram? wrote
I found TExtJsJsonDataFormatter has a protected method GetDataContentType that returns 'text/html'. How can I change that value without inheriting from this class? I want to return 'text/json;charset=iso-8859-1'.

Currently you can't. I can implement a property for this, and if it's empty, return text/html.

You should be careful what you return here. Not all types are accepted for some reason.

Michael.

Reply by email