blob: ffcde3bc7c060298d4ef44ddd9c19ba4ff977a44 [file] [log] [blame]
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import <WebKit/WebKit.h>
@class CRWWKScriptMessageRouter;
// Class to load POST requests in a provided web view via JavaScript.
@interface CRWJSPOSTRequestLoader : NSObject
// Asynchronously loads a POST |request| in provided |webView|.
// It temporarily installs JavaScript message routers with |messageRouter| to
// handle HTTP errors. The |completionHandler| is called once the request has
// been executed. In case of successful request, the passed error is nil.
// The |completionHandler| must not be null. The |messageRouter| and |webView|
// must not be nil. The |request| must be a POST request.
- (void)loadPOSTRequest:(NSURLRequest*)request
completionHandler:(void (^)(NSError*))completionHandler;