I can't speak "android", but using postman the following flow works for me:
Request "ContextInfo"
POST /_api/contextinfo HTTP/1.1
Host: my.sharepoint.local
Accept: application/json; odata=verbose
User-Agent: PostmanRuntime/7.15.0
Cache-Control: no-cache
Postman-Token: dac3ee21-85b6-4c86-8015-3bb9646e25a9,523b0e7b-7d02-4aee-b078-83af480696a1
Host: my.sharepoint.local
accept-encoding: gzip, deflate
content-length:
Connection: keep-alive
cache-control: no-cache
which returns data.. i.e.:
{
"d": {
"GetContextWebInformation": {
"__metadata": {
"type": "SP.ContextWebInformation"
},
"FormDigestTimeoutSeconds": 1800,
"FormDigestValue": "0x01524F8681FE5C746F329FA4CC040A709D0BCAFA2B6BA590397F40559C1787F314201BA81B0046F37CCF9C68282655AD042FC37B1A872670759B41FC9285FF3D,02 Jul 2019 13:03:18 -0000",
"LibraryVersion": "16.0.4744.1000",
"SiteFullUrl": "https://my.sharepoint.local",
"SupportedSchemaVersions": {
"__metadata": {
"type": "Collection(Edm.String)"
},
"results": [
"14.0.0.0",
"15.0.0.0"
]
},
"WebFullUrl": "https://my.sharepoint.local"
}
}
}
using that FormDigestValue
as the X-RequestDigest
in the next request:
POST /_api/web/lists/GetByTitle('Test')/items? HTTP/1.1
Host: my.sharepoint.local
Accept: application/json; odata=verbose
Content-Type: application/json
X-RequestDigest: 0x01524F8681FE5C746F329FA4CC040A709D0BCAFA2B6BA590397F40559C1787F314201BA81B0046F37CCF9C68282655AD042FC37B1A872670759B41FC9285FF3D,02 Jul 2019 13:03:18 -0000
User-Agent: PostmanRuntime/7.15.0
Cache-Control: no-cache
Postman-Token: 87735fcd-5f15-4f31-9b7e-62f5a3050b72,a798e358-5d14-4f26-9bfd-c50989850153
Host: my.sharepoint.local
accept-encoding: gzip, deflate
content-length: 29
Connection: keep-alive
cache-control: no-cache
{
'Title': 'New title'
}
Creates a new item in the list named Test
.