Domanda

Seems like a bug in scribe. It is using java.net.HttpURLConnection which is limited to

/* valid HTTP methods */
private static final String[] methods = {
    "GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "TRACE"
};

There's no easy way to override this part (to use apache httpClient for instance) and there's a constant in Scribe org.scribe.model.Verb.PATCH, which basically never works with the rest of scribe code as it is now.

Any easy workarounds?

È stato utile?

Soluzione

For the moment Im removing PATCH from scribe list of available http verbs:

https://github.com/fernandezpablo85/scribe-java/commit/65ae79d2702ccb192161db8fc6d1edaa5df07be8

On the workaround side, I've found the jersey guys had the same issue and used reflection to get around it.

Altri suggerimenti

you can use "x-http-method-override" header parameter to over ride HTTP Method please go through below sample code i was using using 'POST' method but overriding it with 'PATCH'

OAuthRequest request = new OAuthRequest(Verb.POST,url);
request.addHeader("x-http-method-override", "PATCH");  
Service.signRequest(konyAccessToken, request);//service is OAuthService instance      
String result = response.getBody();

this work for other HTTP Methods like DELETE,TRACE....

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top