Jump to content

LabVIEWHTTPClient.lvlib - PATCH Method


Recommended Posts

I'm trying to use the LabVIEWHTTPClient.lvlib functions to communicate with Salesforce.com

 

I can authenticate, but my Salesforce IT guy tells me that Salesforce uses a concept called "upsert". It's update and insert combined; but I need to use the PATCH Method instead of a PUT or POST method.

 

I can't seem to find any reference to the PATCH method.

 

I believe the LabVIEW library uses curl under the hood.

 

Anyone have any ideas?

 

 

HEADER:

HTTP/1.1 405 Method Not Allowed
Date: Fri, 16 Oct 2015 19:20:35 GMT
Sforce-Limit-Info: api-usage=36839/7918000
Allow: GET,HEAD,PATCH,DELETE
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
 

BODY:

[{"errorCode":"METHOD_NOT_ALLOWED","message":"HTTP Method 'POST' not allowed. Allowed are GET,HEAD,PATCH,DELETE"}]

 

Link to comment

"Upsert" is a database function. I don't know how the salesforce thing is set up but I don't think this has anything to do with HTTP but is probably describing a query executed by the HTTP request.

 

PATCH is detailed here. It won't help you with using the NI HTTP VIs though because I believe they only implement GET and POST. You will have to fall back to the TCPIP primitives and hand craft the HTTP headers and body. Maybe Rolfs HTTP VIs would be useful here.

Link to comment
  • 2 weeks later...

I was traveling last week, so I didn't get to spend much time on this.

 

While searching salesforce.com I discovered that you can override the POST method with an arbitrary method name by appending to the URL.

 

https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_update_fields.htm

 

Append "?_HttpMethod=PATCH" and Bob's your uncle!

Edited by Phillip Brooks
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.