Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I make it customize display of my GET request on service stack?

Tags:

servicestack

When I make GET request on my service stack it is working fine. Thanks to service stack, to make a developer work very easy. On the page, I am having two queries. May be some one can help me. according to me it is always better to know for what you are working and how the internal thing works.

enter image description here

see the above image, when I send GET request on service stack, it displays me this kind of layout.

1>I want to know can I make it customize display. i.e. can I remove the sentence "SnapShot of ....." (the big header)

2>I want to know, why it takes space in header of table (the result table) for every capital character define in property. i.e. in my project the name of property in class is -> instanceName, which is represented as "instance Name" in header .

Can anyone tell me what is the reason behind this?

like image 225
amit patel Avatar asked Oct 10 '22 12:10

amit patel


1 Answers

The implementation of the HtmlFormat is in a single class at: https://github.com/ServiceStack/ServiceStack/blob/master/src/ServiceStack/WebHost.Endpoints/Formats/HtmlFormat.cs

It allows some customization, e.g:

HtmlFormat.TitleFormat = "";
HtmlFormat.HtmlTitleFormat = "";

The default behavior like splitting the case of the header labels was specifically added to make it more readable. To change this you are going to have to download the source code, make changes to the class yourself and cut a new build. This is the line that does the split-camel-casing:

https://github.com/ServiceStack/ServiceStack/blob/master/src/ServiceStack/WebHost.EndPoints/Formats/HtmlFormat.cs#L289

You can read more about the JSON HTML Report Format used at: https://github.com/ServiceStack/ServiceStack/wiki/HTML5ReportFormat

like image 161
mythz Avatar answered Oct 23 '22 08:10

mythz