Using the API, I have written a file to a SharePoint app inside of a folder. Then I make a call to update it with some metadata. The body of the request has some Unicode characters but I get an error returned (e.g. "Örebro—Kyrkoböcker"). What do I need to add to the request to communicate to SharePoint to allow Unicode characters in the body of the request? Is this even allowed?
POST https://sites-test.ldschurch.org/sites/worldservertest1/_api/Web/Lists(guid'7787c88e-7301-4ada-84fa-d30b5a808109')/Items(2363) HTTP/1.1
Content-Type: application/json;odata=verbose
Accept: application/json;odata=verbose
IF-MATCH: *
X-HTTP-Method: MERGE
X-RequestDigest: 0x2E75F594DAC1EF31D79C19C1B562DD843C31353FBE69D0277A7906233E91073670989CEE40E7A261CA50C22D326A48CF71FE0A42E42C451909CB88B23D5E8CB2,04 Nov 2014 16:38:03 -0000
Content-Length: 373
Host: sites-test.ldschurch.org
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.3.4 (java 1.5)
Accept-Encoding: gzip,deflate
Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEgAAADCAMIAYAAAAAYABgAiAQAADgAOACgBAAAAAAAANgEAAAAAAAA2AQAABYKIogUBKAoAAAAPkV0IHOkgeQOPcWIw3qcycdNgiKw1hpRV6XYmDu/rTDAR1dY0uSgFQQEBAAAAAAAAgLANtE34zwEVd05kFeC/qAAAAAACAAYATABEAFMAAQAMAFcAMQAyADYANQA2AAQAGgBsAGQAcwBjAGgAdQByAGMAaAAuAG8AcgBnAAMAKABXADEAMgA2ADUANgAuAGwAZABzAGMAaAB1AHIAYwBoAC4AbwByAGcABQAaAGwAZABzAGMAaAB1AHIAYwBoAC4AbwByAGcABwAIAFirIbRN+M8BAAAAAAAAAABMAEQAUwBmAHIAaQB0AGMAaABkAA==
{ '__metadata': { 'type': 'SP.Data.SourceItem' } , 'productNumber': 'PD10050912', 'wsLanguage': '000_English', 'projectID': 'C89', 'fileType': 'Scope', 'productComponent': '', 'englishApprovalDate': '2/01/2014', 'wsStatus': '', 'translatedFrom': '000_English', 'productName': 'Sverige, []rebro?Kyrkob[]cker', 'projectName': 'Sverige, []rebro?Kyrkob[]cker', 'fileNamePath': '' }
I get this response:
HTTP/1.1 500 Internal Server Error
Cache-Control: private, max-age=0
Transfer-Encoding: chunked
Content-Type: application/json;odata=verbose;charset=utf-8
Expires: Mon, 20 Oct 2014 15:38:03 GMT
Last-Modified: Tue, 04 Nov 2014 16:38:03 GMT
Server: Microsoft-IIS/7.5
X-SharePointHealthScore: 0
SPClientServiceRequestDuration: 145
X-AspNet-Version: 4.0.30319
SPRequestGuid: 87ddc89c-ae01-80f2-a96f-787c03a7c543
request-id: 87ddc89c-ae01-80f2-a96f-787c03a7c543
X-RequestDigest: 0x2E75F594DAC1EF31D79C19C1B562DD843C31353FBE69D0277A7906233E91073670989CEE40E7A261CA50C22D326A48CF71FE0A42E42C451909CB88B23D5E8CB2,04 Nov 2014 16:38:03 -0000
X-FRAME-OPTIONS: SAMEORIGIN
Persistent-Auth: true
X-Powered-By: ASP.NET
MicrosoftSharePointTeamServices: 15.0.0.4569
X-Content-Type-Options: nosniff
X-MS-InvokeApp: 1; RequireReadOnly
Date: Tue, 04 Nov 2014 16:38:03 GMT
b3
{"error":{"code":"-1, System.Text.DecoderFallbackException","message":{"lang":"en-US","value":"Unable to translate bytes [D6] at index 286 from specified code page to Unicode."}}}
0
When I remove the Unicode characters from the request it responds with a 204.
POST https://sites-test.ldschurch.org/sites/worldservertest1/_api/Web/Lists(guid'7787c88e-7301-4ada-84fa-d30b5a808109')/Items(2363) HTTP/1.1
Content-Type: application/json;odata=verbose
Accept: application/json;odata=verbose
IF-MATCH: *
X-HTTP-Method: MERGE
X-RequestDigest: 0x31DB71CE0A4A9EC5F580A515D1EE677D7AE16BB1364965F1B64815A44828948515233441BAFBA4B5CA7C0B47B8A20E929D413D21AF5349C21ADF6A6CFC5C873F,04 Nov 2014 16:49:20 -0000
Content-Length: 373
Host: sites-test.ldschurch.org
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.3.4 (java 1.5)
Accept-Encoding: gzip,deflate
Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEgAAADCAMIAYAAAAAYABgAiAQAADgAOACgBAAAAAAAANgEAAAAAAAA2AQAABYKIogUBKAoAAAAPXQlqYSJet7AkHotNhlUuWSr/a3k3trp51pCMp1uW0jGPTLnZyK78AwEBAAAAAAAAMAMCSE/4zwF13920TUjtKwAAAAACAAYATABEAFMAAQAMAFcAMQAyADYANQA2AAQAGgBsAGQAcwBjAGgAdQByAGMAaAAuAG8AcgBnAAMAKABXADEAMgA2ADUANgAuAGwAZABzAGMAaAB1AHIAYwBoAC4AbwByAGcABQAaAGwAZABzAGMAaAB1AHIAYwBoAC4AbwByAGcABwAIAHwTE0hP+M8BAAAAAAAAAABMAEQAUwBmAHIAaQB0AGMAaABkAA==
{ '__metadata': { 'type': 'SP.Data.SourceItem' } , 'productNumber': 'PD10050912', 'wsLanguage': '000_English', 'projectID': 'C89', 'fileType': 'Scope', 'productComponent': '', 'englishApprovalDate': '2/01/2014', 'wsStatus': '', 'translatedFrom': '000_English', 'productName': 'Sverige, Orebro?Kyrkobocker', 'projectName': 'Sverige, Orebro?Kyrkobocker', 'fileNamePath': '' }
HTTP/1.1 204 No Content
Cache-Control: private, max-age=0
Expires: Mon, 20 Oct 2014 15:49:21 GMT
Last-Modified: Tue, 04 Nov 2014 16:49:21 GMT
ETag: "2"
Server: Microsoft-IIS/7.5
X-SharePointHealthScore: 0
SPClientServiceRequestDuration: 597
X-AspNet-Version: 4.0.30319
SPRequestGuid: 2cdec89c-2e76-80f2-a96f-7663292d6a9a
request-id: 2cdec89c-2e76-80f2-a96f-7663292d6a9a
X-RequestDigest: 0x46148E91F1CDBA8FB8F8E0FB576AD48F9922F8E095133321E71616B2F3013D28EB2921D93EB075A9D8E34BD58D5EBF752952B31E8051488A174A4F771A36AA77,04 Nov 2014 16:49:21 -0000
X-FRAME-OPTIONS: SAMEORIGIN
Persistent-Auth: true
X-Powered-By: ASP.NET
MicrosoftSharePointTeamServices: 15.0.0.4569
X-Content-Type-Options: nosniff
X-MS-InvokeApp: 1; RequireReadOnly
Date: Tue, 04 Nov 2014 16:49:21 GMT