public RequiredPostValue ( string key ) : string | ||
key | string | |
Результат | string |
public string RequiredPostValue(string key)
{
Debug.Assert(_requestInfo.HttpMethod == HttpMethods.Post);
var values = _requestInfo.GetPostDataWhenFormEncoded().GetValues(key);
if(values == null || values.Length != 1)
throw new ApplicationException("The query " + _requestInfo.RawUrl + " should have 1 value for "+key);
return values[0];
}
public void ProcessDirectoryWatcher(ApiRequest request) { // thread synchronization is done in the calling BloomApiHandler. var dirName = request.RequiredPostValue("dir"); if (dirName == "Sample Texts") { CheckForSampleTextChanges(request); } else { request.Failed(); } }