コード例 #1
0
ファイル: Context.cs プロジェクト: Bulkas456/NJsonApi
 public Context()
 {
     this.baseUri = new Lazy <Uri>(() =>
     {
         UriComponents authority = (UriComponents.Scheme | UriComponents.UserInfo | UriComponents.Host | UriComponents.Port);
         return(new Uri(RequestUri.GetComponents(authority, UriFormat.SafeUnescaped)));
     });
 }
コード例 #2
0
ファイル: HttpBucketWebRequest.cs プロジェクト: AmpScm/AmpScm
        internal virtual Bucket CreateRequest()
        {
            Encoding enc = RequestEncoding;

#pragma warning disable CA2000 // Dispose objects before losing scope
            return(enc.GetBytes((Method ?? "GET") + " ").AsBucket()
                   + enc.GetBytes(RequestUri.GetComponents(UriComponents.PathAndQuery, UriFormat.UriEscaped)).AsBucket()
                   + enc.GetBytes(" HTTP/1.1\r\n").AsBucket()
                   + CreateHeaders(RequestUri.Host));

#pragma warning restore CA2000 // Dispose objects before losing scope
        }
コード例 #3
0
 private protected override BucketClientChannel CreateChannel(Bucket reader, IBucketWriter writer)
 {
     return(new BucketClientChannel(Client, RequestUri.GetComponents(UriComponents.SchemeAndServer, UriFormat.Unescaped), reader, writer));
 }