/// <summary> /// Validates the specified AtomPub request. /// </summary> /// <param name="context">An instance of HttpContext containing the request details.</param> /// <param name="errorMessage">An error message describing the reason if validation is failed.</param> /// <returns>True if the request is valid, otherwise false.</returns> public bool ValidateRequest(HttpContext context, out string errorMessage) { string httpRequestType = context.Request.RequestType.ToUpperInvariant(); // Verify request type is GET, PUT, POST, DELETE if (!(PlatformConstants.GetRequestType == httpRequestType || PlatformConstants.PutRequestType == httpRequestType || PlatformConstants.PostRequestType == httpRequestType || PlatformConstants.DeleteRequestType == httpRequestType)) { errorMessage = Resources.ATOMPUB_INVALID_METHOD; return(false); } Uri baseUri = new Uri(AtomPubHelper.GetBaseUri()); AtomPubRequestType requestType = AtomPubHelper.GetAtomPubRequestType(context, baseUri); bool isValidRequest = AtomPubRequestType.Unknwon != requestType; errorMessage = (isValidRequest) ? string.Empty : Resources.ATOMPUB_BAD_REQUEST; return(isValidRequest); }
/// <summary> /// Initializes a new instance of the <see cref="AtomPubGetProcessor"/> class. /// </summary> public AtomPubGetProcessor() : this(AtomPubHelper.GetBaseUri()) { }
/// <summary> /// Initializes a new instance of the <see cref="ZentityAtomPubStoreWriter"/> class. /// </summary> public ZentityAtomPubStoreWriter() : this(AtomPubHelper.GetBaseUri()) { }