Re: [google-appengine] Support for HTTP Patch in URLFetch

2011-09-26 Thread Sean Murphy
Hi Nick,

You should probably send this to google-appengine-python@ instead, then.


Thanks - given that I've start this here, I'll finish it here. (I did look 
for the appengine
python list, but could not find it easily - could I suggest that a pointer 
to the group be
put in the welcome and readme for this group?)
 

 I'm doing some work using the Salesforce REST API. This API uses the HTTP 
 Patch
 command to update an object in SF. I note that URLFetch currently does not 
 support
 Patch - any plans to support in future?


 PATCH is actually a part of WebDav, not HTTP. If you'd like support for it 
 added to urlfetch, you should file a feature request on the issue tracker.

 
I'm a little confused - Salesforce does refer to it as a HTTP command and 
this RFC

http://tools.ietf.org/html/rfc5789

does give the impression that it is part of HTTP rather than Webdav. Any 
chance you'd
be able to shed further light on this?
 

 I think the solution is to use httplib2 - it's a bit clunky, however.


 Unfortunately, I don't believe this will work - httplib is just a wrapper 
 for URLFetch, so any restrictions that apply to URLFetch apply equally to 
 httplib(2).


This can work using the following (which I got from some SF examples):

queryConn = httplib2.Http()
resp,content = queryConn.request( obj_url+'?_HttpMethod=PATCH',
  POST,
  headers= {'Authorization': 'OAuth 
'+access_token, 'Content-Type':' application/json'},
  body=simplejson.dumps(update_fields) )

I have not looked into what happens under the hood, however...

BR,
Seán.

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine/-/XSp99pCaBh4J.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



Re: [google-appengine] Support for HTTP Patch in URLFetch

2011-09-26 Thread Nick Johnson
On Mon, Sep 26, 2011 at 7:57 PM, Sean Murphy seanm5t45...@gmail.com wrote:

 Hi Nick,

 You should probably send this to google-appengine-python@ instead, then.


 Thanks - given that I've start this here, I'll finish it here. (I did look
 for the appengine
 python list, but could not find it easily - could I suggest that a pointer
 to the group be
 put in the welcome and readme for this group?)


 I'm doing some work using the Salesforce REST API. This API uses the HTTP
 Patch
 command to update an object in SF. I note that URLFetch currently does
 not support
 Patch - any plans to support in future?


 PATCH is actually a part of WebDav, not HTTP. If you'd like support for it
 added to urlfetch, you should file a feature request on the issue tracker.


 I'm a little confused - Salesforce does refer to it as a HTTP command and
 this RFC

 http://tools.ietf.org/html/rfc5789

 does give the impression that it is part of HTTP rather than Webdav. Any
 chance you'd
 be able to shed further light on this?


You're right - it's not part of webdav specifically. That RFC extends HTTP,
though, so it's not a part of HTTP/1.1.




 I think the solution is to use httplib2 - it's a bit clunky, however.


 Unfortunately, I don't believe this will work - httplib is just a wrapper
 for URLFetch, so any restrictions that apply to URLFetch apply equally to
 httplib(2).


 This can work using the following (which I got from some SF examples):

 queryConn = httplib2.Http()
 resp,content = queryConn.request( obj_url+'?_HttpMethod=PATCH',
   POST,
   headers= {'Authorization': 'OAuth
 '+access_token, 'Content-Type':' application/json'},
   body=simplejson.dumps(update_fields)
 )

 I have not looked into what happens under the hood, however...


All this is doing is making a POST request, specifying a query string
parameter '_HttpMethod'. You can do this using urlfetch, urllib, or the
mechanism of your choice.

-Nick Johnson



 BR,
 Seán.

  --
 You received this message because you are subscribed to the Google Groups
 Google App Engine group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-appengine/-/XSp99pCaBh4J.

 To post to this group, send email to google-appengine@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-appengine?hl=en.




-- 
Nick Johnson, Developer Programs Engineer, App Engine

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



Re: [google-appengine] Support for HTTP Patch in URLFetch

2011-09-25 Thread Nick Johnson
On Fri, Sep 23, 2011 at 8:46 PM, Sean Murphy seanm5t45...@gmail.com wrote:

 Hi,

 Issue for GAE-python.


You should probably send this to google-appengine-python@ instead, then.



 I'm doing some work using the Salesforce REST API. This API uses the HTTP
 Patch
 command to update an object in SF. I note that URLFetch currently does not
 support
 Patch - any plans to support in future?


PATCH is actually a part of WebDav, not HTTP. If you'd like support for it
added to urlfetch, you should file a feature request on the issue tracker.



 I think the solution is to use httplib2 - it's a bit clunky, however.


Unfortunately, I don't believe this will work - httplib is just a wrapper
for URLFetch, so any restrictions that apply to URLFetch apply equally to
httplib(2).

-Nick Johnson



 Thoughts/comments appreciated.

 BR,
 Seán.

  --
 You received this message because you are subscribed to the Google Groups
 Google App Engine group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-appengine/-/bnDsbTzsfYgJ.
 To post to this group, send email to google-appengine@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-appengine?hl=en.




-- 
Nick Johnson, Developer Programs Engineer, App Engine

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



[google-appengine] Support for HTTP Patch in URLFetch

2011-09-23 Thread Sean Murphy
Hi,

Issue for GAE-python.

I'm doing some work using the Salesforce REST API. This API uses the HTTP 
Patch
command to update an object in SF. I note that URLFetch currently does not 
support
Patch - any plans to support in future?

I think the solution is to use httplib2 - it's a bit clunky, however.

Thoughts/comments appreciated.

BR,
Seán.

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine/-/bnDsbTzsfYgJ.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.