[SharePoint 2010] Updates are currently disallowed on GET requests. To allow updates on a GET, set the ‘AllowUnsafeUpdates’ property on SPWeb.

I was working on a WCF web service that is hosted by SharePoint 2010 that provisions a users My Site and I kept getting this error message when trying to run the service:

Updates are currently disallowed on GET requests. To allow updates on a GET, 
set the 'AllowUnsafeUpdates' property on SPWeb.

In searching the issue, I found a workaround on the MSDN forums that works quite well: set the current HttpContext to null. When the current HttpContext is null, SharePoint does not know that the request was made during a GET request.

I found this extremely helpful and wanted to share.

1 Comment

Submit a Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

Pin It on Pinterest

Share This