CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of REST
C#
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");
by Carlos Figueira   October 10, 2011 @ 9:57pm
Tags: WCF, Rest
137 Views
no comments
 
C#
<%@ 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]
by Carlos Figueira   October 10, 2011 @ 9:55pm
Tags: WCF, Rest
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",
by frank2tek   October 04, 2011 @ 11:25am
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">
by frank2tek   October 04, 2011 @ 11:20am
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>
by M1ST3R10   December 03, 2010 @ 12:53pm
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; }
by M1ST3R10   December 03, 2010 @ 12:53pm
109 Views
no comments
 
C#
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() {}
by Glenn Block   June 26, 2010 @ 11:50am
Tags: REST
602 Views
no comments
 
C#
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;
by Rick Strahl   August 10, 2009 @ 4:44pm
1013 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate