Code:
/ DotNET / DotNET / 8.0 / untmp / Orcas / RTM / ndp / fx / src / xsp / System / Web / Extensions / Script / Services / RestHandlerFactory.cs / 1 / RestHandlerFactory.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Script.Services { internal class RestHandlerFactory : IHttpHandlerFactory { internal const string ClientProxyRequestPathInfo = "/js"; internal const string ClientDebugProxyRequestPathInfo = "/jsdebug"; public virtual IHttpHandler GetHandler(HttpContext context, string requestType, string url, string pathTranslated) { if (context == null) { throw new ArgumentNullException("context"); } if (IsClientProxyRequest(context.Request.PathInfo)) { // It's a request for client side proxies return new RestClientProxyHandler(); } else { // The request is an actual call to a server method return RestHandler.CreateHandler(context); } } public virtual void ReleaseHandler(IHttpHandler handler) { } // Detects if this is a request we want to intercept, i.e. invocation or proxy request internal static bool IsRestRequest(HttpContext context) { return IsRestMethodCall(context.Request) || IsClientProxyRequest(context.Request.PathInfo); } // Detects if this is a method invocation, i.e. webservice call or page method call internal static bool IsRestMethodCall(HttpRequest request) { return !String.IsNullOrEmpty(request.PathInfo) && (request.ContentType.StartsWith("application/json;", StringComparison.OrdinalIgnoreCase) || string.Equals(request.ContentType, "application/json", StringComparison.OrdinalIgnoreCase)); } internal static bool IsClientProxyDebugRequest(string pathInfo) { return string.Equals(pathInfo, ClientDebugProxyRequestPathInfo, StringComparison.OrdinalIgnoreCase); } internal static bool IsClientProxyRequest(string pathInfo) { return (string.Equals(pathInfo, ClientProxyRequestPathInfo, StringComparison.OrdinalIgnoreCase) || IsClientProxyDebugRequest(pathInfo)); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- BaseUriHelper.cs
- EmptyStringExpandableObjectConverter.cs
- SessionIDManager.cs
- CustomError.cs
- StateMachineWorkflowDesigner.cs
- CryptoApi.cs
- MenuItemBindingCollection.cs
- SchemaTableColumn.cs
- RequiredAttributeAttribute.cs
- StackOverflowException.cs
- KeyFrames.cs
- WebPart.cs
- WmiPutTraceRecord.cs
- Simplifier.cs
- BaseHashHelper.cs
- ControlOperationInvoker.cs
- Configuration.cs
- CounterSampleCalculator.cs
- Splitter.cs
- HScrollBar.cs
- AuthenticationManager.cs
- WmlImageAdapter.cs
- VirtualPathData.cs
- NavigationPropertyAccessor.cs
- UpdateTracker.cs
- CacheVirtualItemsEvent.cs
- OracleTransaction.cs
- CanonicalizationDriver.cs
- ContextInformation.cs
- FontFamily.cs
- FamilyMap.cs
- AsyncDataRequest.cs
- VisualStyleRenderer.cs
- SoapException.cs
- ThemeInfoAttribute.cs
- ObjectContextServiceProvider.cs
- Subtree.cs
- BoundField.cs
- Rotation3DAnimationUsingKeyFrames.cs
- Binding.cs
- DataPagerFieldCollection.cs
- UriScheme.cs
- ServiceModelEnumValidator.cs
- httpstaticobjectscollection.cs
- FileSecurity.cs
- ThreadSafeList.cs
- _AuthenticationState.cs
- SqlRecordBuffer.cs
- HostingEnvironmentWrapper.cs
- SwitchCase.cs
- SqlParameterCollection.cs
- DbProviderManifest.cs
- SettingsAttributes.cs
- XmlDataProvider.cs
- unsafeIndexingFilterStream.cs
- TimeSpanConverter.cs
- XmlElement.cs
- SecurityCriticalDataForSet.cs
- ExpandCollapseProviderWrapper.cs
- ExpressionQuoter.cs
- DocumentScope.cs
- OdbcDataAdapter.cs
- Point.cs
- ByteAnimationUsingKeyFrames.cs
- RecordManager.cs
- HwndSourceParameters.cs
- VScrollProperties.cs
- DataGridViewMethods.cs
- ResourcePermissionBaseEntry.cs
- XmlSortKey.cs
- ClientRuntimeConfig.cs
- DatePickerDateValidationErrorEventArgs.cs
- TypeUnloadedException.cs
- AlternateView.cs
- CompositionTarget.cs
- SrgsRule.cs
- RelatedView.cs
- ping.cs
- PerformanceCounterLib.cs
- Base64Encoding.cs
- Ref.cs
- LifetimeMonitor.cs
- NamespaceInfo.cs
- TraceSection.cs
- TraceHandlerErrorFormatter.cs
- FormsAuthenticationCredentials.cs
- HttpListenerRequest.cs
- RadialGradientBrush.cs
- BaseInfoTable.cs
- SoapBinding.cs
- DrawListViewItemEventArgs.cs
- BindUriHelper.cs
- HttpClientCertificate.cs
- RouteItem.cs
- SignatureConfirmationElement.cs
- AnnotationService.cs
- MDIControlStrip.cs
- RemotingAttributes.cs
- DataBinder.cs
- BamlVersionHeader.cs