---
http_interactions:
- request:
    method: post
    uri: http://admin:passwd@win7dev:8989/SampleService/BasicAuth/RubyOData.svc/Categories
    body:
      encoding: ASCII-8BIT
      string: ! '{"Name":"Auth Test Category","AuditFields":{"CreatedBy":"Machinist"}}'
    headers:
      Accept:
      - ! '*/*; q=0.5, application/xml'
      Accept-Encoding:
      - gzip, deflate
      Content-Type:
      - application/json
      Content-Length:
      - '69'
      User-Agent:
      - Ruby
  response:
    status:
      code: 201
      message: Created
    headers:
      Cache-Control:
      - no-cache
      Content-Length:
      - '1278'
      Content-Type:
      - application/atom+xml;type=entry;charset=utf-8
      Location:
      - http://win7dev:8989/SampleService/BasicAuth/RubyOData.svc/Categories(1)
      Server:
      - Microsoft-IIS/7.5
      Set-Cookie:
      - ASP.NET_SessionId=b5h3vo0kbga5mdcgu2nfisos; path=/; HttpOnly
      X-Content-Type-Options:
      - nosniff
      Dataserviceversion:
      - 1.0;
      X-Aspnet-Version:
      - 4.0.30319
      X-Powered-By:
      - ASP.NET
      Date:
      - Tue, 07 Aug 2012 21:21:24 GMT
    body:
      encoding: US-ASCII
      string: <?xml version="1.0" encoding="utf-8"?><entry xml:base="http://win7dev:8989/SampleService/BasicAuth/RubyOData.svc/"
        xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
        xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss"
        xmlns:gml="http://www.opengis.net/gml"><id>http://win7dev:8989/SampleService/BasicAuth/RubyOData.svc/Categories(1)</id><category
        term="RubyODataService.Category" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
        /><link rel="edit" title="Category" href="Categories(1)" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Products"
        type="application/atom+xml;type=feed" title="Products" href="Categories(1)/Products"
        /><title /><updated>2012-08-07T21:21:25Z</updated><author><name /></author><content
        type="application/xml"><m:properties><d:Id m:type="Edm.Int32">1</d:Id><d:Name>Auth
        Test Category</d:Name><d:AuditFields m:type="RubyODataService.AuditFields"><d:CreateDate
        m:type="Edm.DateTime">2012-08-07T21:21:25.296875Z</d:CreateDate><d:ModifiedDate
        m:type="Edm.DateTime">2012-08-07T21:21:25.296875Z</d:ModifiedDate><d:CreatedBy>Machinist</d:CreatedBy></d:AuditFields></m:properties></content></entry>
    http_version: !!null 
  recorded_at: Tue, 07 Aug 2012 21:21:25 GMT
- request:
    method: get
    uri: http://admin:passwd@win7dev:8989/SampleService/BasicAuth/RubyOData.svc/Categories(1)
    body:
      encoding: US-ASCII
      string: ''
    headers:
      Accept:
      - ! '*/*; q=0.5, application/xml'
      Accept-Encoding:
      - gzip, deflate
      User-Agent:
      - Ruby
  response:
    status:
      code: 200
      message: OK
    headers:
      Cache-Control:
      - no-cache
      Content-Length:
      - '1270'
      Content-Type:
      - application/atom+xml;type=entry;charset=utf-8
      Server:
      - Microsoft-IIS/7.5
      Set-Cookie:
      - ASP.NET_SessionId=vqh02cwip2bvnmgt4smeb5ok; path=/; HttpOnly
      X-Content-Type-Options:
      - nosniff
      Dataserviceversion:
      - 1.0;
      X-Aspnet-Version:
      - 4.0.30319
      X-Powered-By:
      - ASP.NET
      Date:
      - Tue, 07 Aug 2012 21:21:24 GMT
    body:
      encoding: US-ASCII
      string: <?xml version="1.0" encoding="utf-8"?><entry xml:base="http://win7dev:8989/SampleService/BasicAuth/RubyOData.svc/"
        xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
        xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss"
        xmlns:gml="http://www.opengis.net/gml"><id>http://win7dev:8989/SampleService/BasicAuth/RubyOData.svc/Categories(1)</id><category
        term="RubyODataService.Category" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
        /><link rel="edit" title="Category" href="Categories(1)" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Products"
        type="application/atom+xml;type=feed" title="Products" href="Categories(1)/Products"
        /><title /><updated>2012-08-07T21:21:25Z</updated><author><name /></author><content
        type="application/xml"><m:properties><d:Id m:type="Edm.Int32">1</d:Id><d:Name>Auth
        Test Category</d:Name><d:AuditFields m:type="RubyODataService.AuditFields"><d:CreateDate
        m:type="Edm.DateTime">2012-08-07T21:21:25.297</d:CreateDate><d:ModifiedDate
        m:type="Edm.DateTime">2012-08-07T21:21:25.297</d:ModifiedDate><d:CreatedBy>Machinist</d:CreatedBy></d:AuditFields></m:properties></content></entry>
    http_version: !!null 
  recorded_at: Tue, 07 Aug 2012 21:21:25 GMT
- request:
    method: get
    uri: http://admin:bad_pwd@win7dev:8989/SampleService/BasicAuth/RubyOData.svc/$metadata
    body:
      encoding: US-ASCII
      string: ''
    headers:
      Accept:
      - ! '*/*; q=0.5, application/xml'
      Accept-Encoding:
      - gzip, deflate
      User-Agent:
      - Ruby
  response:
    status:
      code: 401
      message: Unauthorized
    headers:
      Content-Type:
      - text/html
      Server:
      - Microsoft-IIS/7.5
      Www-Authenticate:
      - Basic
      X-Powered-By:
      - ASP.NET
      Date:
      - Tue, 07 Aug 2012 21:21:24 GMT
      Content-Length:
      - '1218'
    body:
      encoding: US-ASCII
      string: ! "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\r\n<html
        xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<title>401 - Unauthorized:
        Access is denied due to invalid credentials.</title>\r\n<style type=\"text/css\">\r\n<!--\r\nbody{margin:0;font-size:.7em;font-family:Verdana,
        Arial, Helvetica, sans-serif;background:#EEEEEE;}\r\nfieldset{padding:0 15px
        10px 15px;} \r\nh1{font-size:2.4em;margin:0;color:#FFF;}\r\nh2{font-size:1.7em;margin:0;color:#CC0000;}
        \r\nh3{font-size:1.2em;margin:10px 0 0 0;color:#000000;} \r\n#header{width:96%;margin:0
        0 0 0;padding:6px 2% 6px 2%;font-family:\"trebuchet MS\", Verdana, sans-serif;color:#FFF;\r\nbackground-color:#555555;}\r\n#content{margin:0
        0 0 2%;position:relative;}\r\n.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}\r\n-->\r\n</style>\r\n</head>\r\n<body>\r\n<div
        id=\"header\"><h1>Server Error</h1></div>\r\n<div id=\"content\">\r\n <div
        class=\"content-container\"><fieldset>\r\n  <h2>401 - Unauthorized: Access
        is denied due to invalid credentials.</h2>\r\n  <h3>You do not have permission
        to view this directory or page using the credentials that you supplied.</h3>\r\n
        </fieldset></div>\r\n</div>\r\n</body>\r\n</html>\r\n"
    http_version: !!null 
  recorded_at: Tue, 07 Aug 2012 21:21:25 GMT
- request:
    method: get
    uri: http://admin:passwd@win7dev:8989/SampleService/BasicAuth/RubyOData.svc/$metadata
    body:
      encoding: US-ASCII
      string: ''
    headers:
      Accept:
      - ! '*/*; q=0.5, application/xml'
      Accept-Encoding:
      - gzip, deflate
      User-Agent:
      - Ruby
  response:
    status:
      code: 200
      message: OK
    headers:
      Cache-Control:
      - no-cache
      Content-Length:
      - '4055'
      Content-Type:
      - application/xml;charset=utf-8
      Server:
      - Microsoft-IIS/7.5
      Set-Cookie:
      - ASP.NET_SessionId=qdj1en0bcagvrdhule4xjvxg; path=/; HttpOnly
      X-Content-Type-Options:
      - nosniff
      Dataserviceversion:
      - 1.0;
      X-Aspnet-Version:
      - 4.0.30319
      X-Powered-By:
      - ASP.NET
      Date:
      - Tue, 07 Aug 2012 21:21:24 GMT
    body:
      encoding: US-ASCII
      string: <?xml version="1.0" encoding="utf-8"?><edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx"><edmx:DataServices
        m:DataServiceVersion="1.0" m:MaxDataServiceVersion="3.0" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><Schema
        Namespace="RubyODataService" xmlns="http://schemas.microsoft.com/ado/2008/09/edm"><EntityType
        Name="Product"><Key><PropertyRef Name="Id" /></Key><Property Name="Id" Type="Edm.Int32"
        Nullable="false" p6:StoreGeneratedPattern="Identity" xmlns:p6="http://schemas.microsoft.com/ado/2009/02/edm/annotation"
        /><Property Name="Name" Type="Edm.String" MaxLength="4000" FixedLength="false"
        Unicode="true" /><Property Name="Description" Type="Edm.String" MaxLength="4000"
        FixedLength="false" Unicode="true" /><Property Name="Price" Type="Edm.Decimal"
        Nullable="false" Precision="18" Scale="2" /><Property Name="DiscontinuedDate"
        Type="Edm.DateTime" /><Property Name="CategoryId" Type="Edm.Int32" Nullable="false"
        /><Property Name="AuditFields" Type="RubyODataService.AuditFields" Nullable="false"
        /><NavigationProperty Name="Category" Relationship="RubyODataService.Category_Products"
        ToRole="Category_Products_Source" FromRole="Category_Products_Target" /></EntityType><ComplexType
        Name="AuditFields"><Property Name="CreateDate" Type="Edm.DateTime" Nullable="false"
        /><Property Name="ModifiedDate" Type="Edm.DateTime" Nullable="false" /><Property
        Name="CreatedBy" Type="Edm.String" MaxLength="4000" FixedLength="false" Unicode="true"
        /></ComplexType><EntityType Name="Category"><Key><PropertyRef Name="Id" /></Key><Property
        Name="Id" Type="Edm.Int32" Nullable="false" p6:StoreGeneratedPattern="Identity"
        xmlns:p6="http://schemas.microsoft.com/ado/2009/02/edm/annotation" /><Property
        Name="Name" Type="Edm.String" MaxLength="4000" FixedLength="false" Unicode="true"
        /><Property Name="AuditFields" Type="RubyODataService.AuditFields" Nullable="false"
        /><NavigationProperty Name="Products" Relationship="RubyODataService.Category_Products"
        ToRole="Category_Products_Target" FromRole="Category_Products_Source" /></EntityType><EntityType
        Name="EdmMetadata"><Key><PropertyRef Name="Id" /></Key><Property Name="Id"
        Type="Edm.Int32" Nullable="false" p6:StoreGeneratedPattern="Identity" xmlns:p6="http://schemas.microsoft.com/ado/2009/02/edm/annotation"
        /><Property Name="ModelHash" Type="Edm.String" MaxLength="4000" FixedLength="false"
        Unicode="true" /></EntityType><Association Name="Category_Products"><End Type="RubyODataService.Product"
        Role="Category_Products_Target" Multiplicity="*" /><End Type="RubyODataService.Category"
        Role="Category_Products_Source" Multiplicity="1"><OnDelete Action="Cascade"
        /></End><ReferentialConstraint><Principal Role="Category_Products_Source"><PropertyRef
        Name="Id" /></Principal><Dependent Role="Category_Products_Target"><PropertyRef
        Name="CategoryId" /></Dependent></ReferentialConstraint></Association><EntityContainer
        Name="RubyODataContext" m:IsDefaultEntityContainer="true"><EntitySet Name="Products"
        EntityType="RubyODataService.Product" /><EntitySet Name="Categories" EntityType="RubyODataService.Category"
        /><EntitySet Name="EdmMetadatas" EntityType="RubyODataService.EdmMetadata"
        /><AssociationSet Name="Category_Products" Association="RubyODataService.Category_Products"><End
        Role="Category_Products_Target" EntitySet="Products" /><End Role="Category_Products_Source"
        EntitySet="Categories" /></AssociationSet><FunctionImport Name="CleanDatabaseForTesting"
        m:HttpMethod="POST" /><FunctionImport Name="EntityCategoryWebGet" ReturnType="Collection(RubyODataService.Category)"
        EntitySet="Categories" m:HttpMethod="GET" /><FunctionImport Name="CategoryNames"
        ReturnType="Collection(Edm.String)" m:HttpMethod="GET" /><FunctionImport Name="FirstCategoryId"
        ReturnType="Edm.Int32" m:HttpMethod="GET" /><FunctionImport Name="EntitySingleCategoryWebGet"
        ReturnType="RubyODataService.Category" EntitySet="Categories" m:HttpMethod="GET"><Parameter
        Name="id" Type="Edm.Int32" /></FunctionImport></EntityContainer></Schema></edmx:DataServices></edmx:Edmx>
    http_version: !!null 
  recorded_at: Tue, 07 Aug 2012 21:21:25 GMT
- request:
    method: get
    uri: http://win7dev:8989/SampleService/BasicAuth/RubyOData.svc/$metadata
    body:
      encoding: US-ASCII
      string: ''
    headers:
      Accept:
      - ! '*/*; q=0.5, application/xml'
      Accept-Encoding:
      - gzip, deflate
      User-Agent:
      - Ruby
  response:
    status:
      code: 401
      message: Unauthorized
    headers:
      Content-Type:
      - text/html
      Server:
      - Microsoft-IIS/7.5
      Www-Authenticate:
      - Basic
      X-Powered-By:
      - ASP.NET
      Date:
      - Tue, 07 Aug 2012 21:21:24 GMT
      Content-Length:
      - '1218'
    body:
      encoding: US-ASCII
      string: ! "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\r\n<html
        xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<title>401 - Unauthorized:
        Access is denied due to invalid credentials.</title>\r\n<style type=\"text/css\">\r\n<!--\r\nbody{margin:0;font-size:.7em;font-family:Verdana,
        Arial, Helvetica, sans-serif;background:#EEEEEE;}\r\nfieldset{padding:0 15px
        10px 15px;} \r\nh1{font-size:2.4em;margin:0;color:#FFF;}\r\nh2{font-size:1.7em;margin:0;color:#CC0000;}
        \r\nh3{font-size:1.2em;margin:10px 0 0 0;color:#000000;} \r\n#header{width:96%;margin:0
        0 0 0;padding:6px 2% 6px 2%;font-family:\"trebuchet MS\", Verdana, sans-serif;color:#FFF;\r\nbackground-color:#555555;}\r\n#content{margin:0
        0 0 2%;position:relative;}\r\n.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}\r\n-->\r\n</style>\r\n</head>\r\n<body>\r\n<div
        id=\"header\"><h1>Server Error</h1></div>\r\n<div id=\"content\">\r\n <div
        class=\"content-container\"><fieldset>\r\n  <h2>401 - Unauthorized: Access
        is denied due to invalid credentials.</h2>\r\n  <h3>You do not have permission
        to view this directory or page using the credentials that you supplied.</h3>\r\n
        </fieldset></div>\r\n</div>\r\n</body>\r\n</html>\r\n"
    http_version: !!null 
  recorded_at: Tue, 07 Aug 2012 21:21:25 GMT
recorded_with: VCR 2.2.4