Hello Brent,

have you tried to annotate your handler with:

@Put("txt")

instead?

On Mon, Jul 18, 2011 at 2:26 PM, Brent Cerrato <[email protected]> wrote:
> My client resource looks like this:
>
>
>
>               Client client = new Client(new Context(), Protocol.HTTP);
>
>               ClientResource pubResource = new
> ClientResource("http://localhost:8111/pcws/1/card/1111222233334444/NIL/hold";);
>
>               pubResource.setNext(client);
>
>               pubResource.put(new
> StringRepresentation("<hold_request><hold_response_code>05</hold_response_code></hold_request>"));
>
>
>
> When I execute that code I get a Method Not Allowed.
>
>
>
> My resource looks like this:
>
>
>
> public class CardHoldResource extends ServerResource {
>
>        public CardHoldResource() {
>
>               super();
>
>               getVariants().add(new Variant(MediaType.TEXT_PLAIN));
>
>        }
>
>
>
>        @Put
>
>        public StringRepresentation createHold(String text) {
>
>                                 ... //do something
>
>                 }
>
> }
>
>
>
>
>
>
>
> When I override put(Representation,Variant) I do the same instanceof check
> that they do in the source... and it fails the check...
>
>
>
> What am I doing wrong to allow me to post with just a simple text body?
>
>
>
> ~brent
>
>



-- 
Fabián Mandelbaum
IS Engineer

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2798838

Reply via email to