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

Client post function fix #3

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

Conversation

zackdesign
Copy link

I discovered that the reason that this function was broken was because Salesforce expected a json array of arguments. This is provisional - maybe this is because it's a new version of their API?

Using correct json_encode arguments. getParams breaks because it isn't JSON.
Using correct json_encode arguments. getParams breaks because it isn't JSON.
@ddeboer
Copy link
Member

ddeboer commented Jun 11, 2014

Thanks for the patch. I haven't been using Salesforce for some time now so I don't know if anything has changed. Can you find anything in their docs?

@zackdesign
Copy link
Author

Actually no. It MAY actually have more to do with the fact that you're not locking the version of Guzzle actually. I'm not 100% sure because I don't know what version of Guzzle you were originally using.

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_rest_code_sample_basic.htm

After looking at the URL above it's pretty clear that it expects application/json content in the body when creating or requesting (in my case tokens) accounts, so I used that to force the post to use json in the body. This worked.

Again, not really sure if Guzzle or Salesforce.

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.

2 participants