CodePaste Logo
New Snippet New Recent Snippets Recent Snippets My Snippets My Snippets My Favorites Favorites 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
1192 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
1173 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
304 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
258 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
783 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
2671 Views
no comments
 
brought to you by:
West Wind Techologies