1: <?php
2: /**
3: * This file is part of the Pipeliner API client library for PHP
4: *
5: * Copyright 2014 Pipelinersales, Inc. All Rights Reserved.
6: * For the full license information, see the attached LICENSE file.
7: */
8:
9: namespace PipelinerSales\ApiClient\Http;
10:
11: /**
12: * A basic interface for HTTP clients
13: */
14: interface HttpInterface
15: {
16: /**
17: * Sends a HTTP request
18: *
19: * @param string $method HTTP method
20: * @param string $url The URL
21: * @param string $rawPayload Body of the request in case of POST/PUT requests. Must already
22: * be encoded in the form expected by the server. Pipeliner's server expects JSON.
23: * @param string $contentType If $rawPayload is not null, specifies the content of the Content-Type header.
24: * @return Response
25: * @throws PipelinerHttpException
26: */
27: public function request($method, $url, $rawPayload = null, $contentType = 'application/json');
28:
29: /**
30: * Sets the user credentials used for authentication
31: *
32: * @param string $username
33: * @param string $password
34: */
35: public function setUserCredentials($username, $password);
36: }
37: