Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

C#

C# controllers for WebApi using Action Names and Verbs

1
2
3
4
5
6
7
[ValidateUser, ActionName("subjects"), HttpPost]
public HttpResponseMessage PostSubject(SubjectDto item)
{
	// 	This means if the controller was called say member, you could then
    //	call this function by api/member/subjects and the verb HttpPost or 
	//	whatever defines the type of action being performed
}
https://snipt.net/embed/44999a792692b2d0be01830da5ac1904/
https://snipt.net/raw/44999a792692b2d0be01830da5ac1904/
44999a792692b2d0be01830da5ac1904
csharp
C#
7
2016-11-29T05:16:00
True
False
False
Jan 06, 2013 at 09:01 AM
/api/public/snipt/52809/
c-controllers-for-webapi-using-action-names-and-verbs
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="na">[ValidateUser, ActionName(&quot;subjects&quot;), HttpPost]</span> </span><span id="L-2"><a name="L-2"></a><span class="k">public</span> <span class="n">HttpResponseMessage</span> <span class="nf">PostSubject</span><span class="p">(</span><span class="n">SubjectDto</span> <span class="n">item</span><span class="p">)</span> </span><span id="L-3"><a name="L-3"></a><span class="p">{</span> </span><span id="L-4"><a name="L-4"></a> <span class="c1">// This means if the controller was called say member, you could then</span> </span><span id="L-5"><a name="L-5"></a> <span class="c1">// call this function by api/member/subjects and the verb HttpPost or </span> </span><span id="L-6"><a name="L-6"></a> <span class="c1">// whatever defines the type of action being performed</span> </span><span id="L-7"><a name="L-7"></a><span class="p">}</span> </span></pre></div> </td></tr></table>
c#, rest, webapi

HTML

Slightly modified pie chart

http://chart.apis.google.com/chart?cht=p&chd=t:60,40&chs=500x200&chl=Florida|Oklahoma&chco=ff4a00,bb0000
https://snipt.net/embed/0b93d989801779a3a8d558dea53c9be7/
https://snipt.net/raw/0b93d989801779a3a8d558dea53c9be7/
0b93d989801779a3a8d558dea53c9be7
html
HTML
1
2016-11-20T00:46:26
True
False
False
/api/public/snipt/456/
slightly-modified-pie-chart
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>http://chart.apis.google.com/chart?cht=p<span class="err">&amp;</span>chd=t:60,40<span class="err">&amp;</span>chs=500x200<span class="err">&amp;</span>chl=Florida|Oklahoma<span class="err">&amp;</span>chco=ff4a00,bb0000 </span></pre></div> </td></tr></table>
chart, google, rest

HTML

Google Charts default 3d-pie chart

http://chart.apis.google.com/chart?cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World
https://snipt.net/embed/2873506b509ed734d225eb494654f730/
https://snipt.net/raw/2873506b509ed734d225eb494654f730/
2873506b509ed734d225eb494654f730
html
HTML
1
2016-11-20T00:33:50
True
False
False
/api/public/snipt/455/
google-charts-default-3d-pie-chart
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>http://chart.apis.google.com/chart?cht=p3<span class="err">&amp;</span>chd=t:60,40<span class="err">&amp;</span>chs=250x100<span class="err">&amp;</span>chl=Hello|World </span></pre></div> </td></tr></table>
chart, google, rest
Copyrighted, illegal, or inappropriate content? Email [email protected].