Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Client.php #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Update Client.php #1

wants to merge 3 commits into from

Conversation

baltazorr
Copy link

For correct work of posting shares, I made some changes. Now it's possible to use GET data and POST data in single request. And now it's posible to send XML POST.

POST data sending as 4 parameter in fetch method.

Worked example from real project:

$client = new \Splash\LinkedIn\Client($apiKey, $secretKey);
$client->setAccessToken($token);
$data = "
  <share>
    <content>
        <title>This is title</title>
        <description>This is body</description>
        <submitted-url>http://someurl.com/</submitted-url>
        <submitted-image-url>http://lorempixel.com/400/400/nightlife/</submitted-image-url>
    </content>
    <visibility>
        <code>anyone</code>
    </visibility>
  </share>";
$response = $client->fetch('/v1/people/~/shares', array(), 'POST', $data);

For correct work of posting shares, I made some changes. Now it's possible to use GET data and POST data in single request. And now it's posible to send XML POST.

POST data sending as 4 parameter in `fetch` method.

Worked example from real project:
$client = new \Splash\LinkedIn\Client($apiKey, $secretKey);
$client->setAccessToken($token);
$data = "
  <share>
	<content>
		<title>This is title</title>
		<description>This is body</description>
		<submitted-url>http://someurl.com/</submitted-url>
		<submitted-image-url>http://lorempixel.com/400/400/nightlife/</submitted-image-url>
	</content>
	<visibility>
		<code>anyone</code>
	</visibility>
  </share>";
$response = $client->fetch('/v1/people/~/shares', array(), 'POST', $data);
@aa21 aa21 mentioned this pull request May 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant