Overview
  • Package
  • Class

Packages

  • Klarna
    • Checkout
  • Payment
    • Klarna
      • HTTP
      • Interfaces
      • Unit
        • Tests

Classes

  • Klarna_Checkout_HTTP_CURLHandle
  • Klarna_Checkout_HTTP_CURLHeaders
  • Klarna_Checkout_HTTP_CURLTransport
  • Klarna_Checkout_HTTP_Request
  • Klarna_Checkout_HTTP_Response

Interfaces

  • Klarna_Checkout_HTTP_CURLHandleInterface

Class Klarna_Checkout_HTTP_Request

Klarna HTTP Request class

Package: Payment\Klarna\HTTP
Category: Payment
Copyright: 2015 Klarna AB
License: Apache license v2.0
Author: Klarna support@klarna.com
Link: http://developers.klarna.com/
Located at Klarna/Checkout/HTTP/Request.php

Methods summary

public
# __construct( string $url )

Initializes a new instance of the HTTP request class.

Initializes a new instance of the HTTP request class.

Parameters

$url
the request URL.

Throws

InvalidArgumentException

If the specified argument is not of type string.

public string
# getURL( )

Gets the request URL.

Gets the request URL.

Returns

string
the request URL.
public
# setMethod( string $method )

Specifies the HTTP method used for the request.

Specifies the HTTP method used for the request.

Parameters

$method
a HTTP method.

Throws

InvalidArgumentException

If the specified argument is not of type string.

public string
# getMethod( )

Gets the HTTP method used for the request.

Gets the HTTP method used for the request.

Returns

string
a HTTP method
public
# setHeader( string $name, mixed $value )

Specifies a header for the request.

Specifies a header for the request.

Parameters

$name
the header name
$value
the header value

Throws

InvalidArgumentException

If the argument name is not of type string or an empty string.

public string|null
# getHeader( string $name )

Gets a specific header for the request.

Gets a specific header for the request.

Parameters

$name
the header name

Returns

string|null
the header value or null if it doesn't exist

Throws

InvalidArgumentException

If the specified argument is not of type string.

public array
# getHeaders( )

Gets the headers specified for the request.

Gets the headers specified for the request.

Returns

array
public
# setData( string $data )

Sets the data (payload) for the request.

Sets the data (payload) for the request.

\code $request->setMethod('POST'); $request->setData('some data'); \endcode

Parameters

$data
the request payload

Throws

InvalidArgumentException

If the specified argument is not of type string.

public string
# getData( )

Gets the data (payload) for the request.

Gets the data (payload) for the request.

Returns

string
the request payload

Magic methods summary

Properties summary

protected string $url

HTTP url

HTTP url

#
protected string $method

HTTP method

HTTP method

#
protected array $headers

HTTP headers

HTTP headers

#
protected string $data

Payload

Payload

#
API documentation generated by ApiGen