Format:
Recent snippets matching tags of REST
class Program { static void Main() { // I have an application in my IIS Site called "ZeroConfig", where the service from http://codepaste.net/s5hwyv is running HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create("http://localhost/ZeroConfig/Service.svc/HelloWorld/test/helloworld"); req.Method = "POST"; req.ContentType = "text/plain"; Stream reqStream = req.GetRequestStream(); byte[] fileToSend = Encoding.UTF8.GetBytes("sometext");
137 Views
no comments
<%@ ServiceHost Language="C#" Debug="true" Service="Service" Factory="System.ServiceModel.Activation.WebServiceHostFactory" %> using System; using System.IO; using System.ServiceModel; using System.ServiceModel.Web; using System.Text; [ServiceContract]
165 Views
no comments
/* Google jquery CDN <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> */ $.ajax( { type: "POST", contentType: "application/json; charset=utf-8", url: "services/FeedService.svc/ServiceMethod", data: '{"param1":"data1" , "param2":"data2"}', dataType: "json",
63 Views
no comments
<system.serviceModel> <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="True"/> <services> <service behaviorConfiguration="SyndicationServerBehavior" name="SimpleBolg.services.FeedService"> <endpoint behaviorConfiguration="AjaxBehavior" binding="webHttpBinding" contract="SimpleBolg.services.IFeedService"/> </service> </services> <behaviors> <serviceBehaviors> <behavior name="SyndicationServerBehavior">
43 Views
no comments
<form action="procesar.php" method="get"> Primer valor: <input type="text" name="valor1" /> Segundo valor: <input type="text" name="valor2" /><br /> <input type="radio" name="radio" value="sumar" />Sumar<br /> <input type="radio" name="radio" value="restar" />Restar<br /> <input type="radio" name="radio" value="dividir" />Dividir<br /> <input type="submit" name="enviar" value="Enviar"> </form>
111 Views
no comments
<?php
if ($_REQUEST['radio'] == "sumar"){
$suma = $_REQUEST['valor1'] + $_REQUEST['valor2'];
echo $suma;
} elseif ($_REQUEST['radio'] == "restar"){
$resta = $_REQUEST['valor1'] - $_REQUEST['valor2'];
echo $resta;
} elseif ($_REQUEST['radio'] == "dividir"){
$dividir = $_REQUEST['valor1'] / $_REQUEST['valor2'];
echo $dividir; }
109 Views
no comments
routes.AddRoute<OrdersResource>("/Orders"); routes.AddRoute<OrdersResource>("/Orders/{Order}") public class OrdersResource { //dependencies can be injected public OrdersResource(IRepository<Order> orderRepository) { } public JsonResponseMessage GetOrders() {} // allows explict mapping for contentneg based on return value public XmlResponseMessage GetOrders() {}
602 Views
no comments
using System; using System.Collections.Generic; using System.Web; using System.Web.Mvc; using Westwind.Utilities; using System.ServiceModel.Syndication; using CodePasteBusiness; using System.Text; using System.Collections; using System.IO;
1013 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
