I'm able to create a global picklist -'Fruits'
String fieldDef = '{"Metadata":{"customValue":[{"label":"Apple","valueName":"Apple"},{"label":"Orange","valueName":"Orange"}],"description":null,"masterLabel":"Fruits","sorted":false,"urls":null},"FullName":"Fruits"}';
HttpRequest req = new HttpRequest();
req.setBody(fieldDef);
req.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionID());
req.setHeader('Content-Type', 'application/json'); req.setEndpoint(URL.getSalesforceBaseUrl().toExternalForm()+'/services/data/v41.0/tooling/sobjects/GlobalValueSet');
req.setMethod('POST');
Http httpreq = new Http();
HttpResponse res = httpreq.send(req);
system.debug(res.getBody());
Now I'm trying to update the 'Fruits' global picklist values. Apple->Grape, Orange->Strawberry
String configType = 'Fruits';
String fieldDef = '{"Metadata":{"customValue":[{"label":"Apple","valueName":"Grape"},{"label":"Orange","valueName":"Strawberry"}],"description":null,"masterLabel":"'+configType+'","sorted":false,"urls":null},"FullName":"'+configType+'"}';
HttpRequest req = new HttpRequest();
req.setBody(fieldDef);
req.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionID());
req.setHeader('Content-Type', 'application/json');
req.setEndpoint(URL.getSalesforceBaseUrl().toExternalForm()+
'/services/data/v41.0/tooling/query/?q=select+id+from+globalvalueset+where+MasterLabel=\''+
configType+'\'+limit+1?_HttpMethod=PATCH');
req.setMethod('POST');
Http httpreq = new Http();
HttpResponse res = httpreq.send(req);
system.debug(res.getBody());
But I'm receiving this error -- [{"errorCode":"METHOD_NOT_ALLOWED","message":"HTTP Method 'POST' not allowed. Allowed are HEAD,GET"}]