An open API service indexing awesome lists of open source software.

https://github.com/peter279k/peter-http

The object-oriented style helper class helps you accessing the HTTP request/response.
https://github.com/peter279k/peter-http

http-client php56 php7

Last synced: about 2 months ago
JSON representation

The object-oriented style helper class helps you accessing the HTTP request/response.

Awesome Lists containing this project

README

          

# wp-http

## Introduction

The object-oriented style helper class helps you accessing the HTTP request/response.

## Usage

- ```git clone https://github.com/peter279k/wp-http.git```
- Please see the more details about the ```main.php```.

## Sample code

- Create the ```api-key.ini``` in this project root path and the ini file contents are as follows:

```
[Facebook]
access_token=define_your_access_token
[Rebrandly]
api_key=define_your_api_key
```

- We use the [Facebook graph API](https://developers.facebook.com/) and [Rebrandly](https://developers.rebrandly.com/docs) API to complete the ```GET``` and ```POST``` examples.

- Please see the ```main.php``` to get the more details about ```GET``` and ```POST``` examples.

## References

Here is the references about the WordPress HTTP API.
- [wp_remote_get](https://codex.wordpress.org/Function_Reference/wp_remote_get)
- [wp_remote_post](https://codex.wordpress.org/Function_Reference/wp_remote_post)
- [wp_remote_request](https://developer.wordpress.org/reference/functions/wp_remote_request)

And in our helper class, we use the ```wp_remote_get``` and ```wp_remote_post``` to complete this project.

## How to solve the curl(60):SSL certificate problem

## TODO

Include the more available CURL options.