Bloom.Api.ApiRequest.RequiredPostString C# (CSharp) Method

RequiredPostString() public method

public RequiredPostString ( ) : string
return string
        public string RequiredPostString()
        {
            Debug.Assert(_requestInfo.HttpMethod == HttpMethods.Post);
            var s = _requestInfo.GetPostString();
            if(!string.IsNullOrWhiteSpace(s))
            {
                return s;
            }
            throw new ApplicationException("The query " + _requestInfo.RawUrl + " should have post string");
        }

Usage Example

Example #1
0
        public void ProcessDirectoryWatcher(ApiRequest request)
        {
            // thread synchronization is done in the calling BloomApiHandler.
            var dirName = request.RequiredPostString("dir");

            if (dirName == "Sample Texts")
            {
                CheckForSampleTextChanges(request);
            }
            else
            {
                request.Failed();
            }
        }
All Usage Examples Of Bloom.Api.ApiRequest::RequiredPostString