OK, I get it now: I have to get the content via a 'data' parameter, not by
calling getEntity() :-)
It now *almost* works perfectly.
I.e., my update method is called, I get the right data, I set the return status
to 'SUCCESS_OK' and I'm done. But the client gets a 'no content' code.
I'm
It's fine if I call setEntity() and return something/anything.
--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=3085219
Usually you just:
return someRepresentation; // This should automatically set status to HTTP
200 (OK)
or:
setStatus(Status.SUCCESS_CREATED); // Set status to HTTP 201
return someRepresentation;
where someRepresentation is the representation for the response you want
to return for the PUT
I have tried sending (PUT) with a content-type of text/plain (verified via
Fiddler). On the server side, I have tried:
@Put(text/plain)
@Put(text)
@Put(plain)
I still get the media error in all cases.
What am I doing wrong? Can I tell Restlet to accept *anything*?
@Put
should be enough to tell Restlet to accept anything
El jul 14, 2014 1:16 PM, Frank Kolnick reallyfr...@hotmail.com escribió:
I have tried sending (PUT) with a content-type of text/plain (verified
via Fiddler). On the server side, I have tried:
@Put(text/plain)
@Put(text)
@Put(plain)
Unfortunately, that does not appear to be the case. I.e., that's where I
started, and was getting the error. I tried the variations in order to fix the
problem, so far without success.
@Put
should be enough to tell Restlet to accept anything
El jul 14, 2014 1:16 PM, Frank Kolnick
Euh... I'm sorry but then the problem must be somewhere else.
I use @Put all the time, handling the different media types myself, and I
only got HTTP 415 when my own-written code explicitly threw
ResourceException(Status.CLIENT_ERROR_UNSUPPORTED_MEDIA_TYPE).
can you please try this on your
FYI, see follow-up here:
http://stackoverflow.com/questions/14409575/unsupported-media-type-415-with-generic-put-or-post
Jerome
2013/1/18 Darwin Airola darwinair...@gmail.com
Aloha!
I was trying to implement a generic put or post method in Restlet. (I was
able to implement a generic Get
H,
I am developing a small app using Restlet 2.0 API..
I want just to know how to create a URI which accepts more than one
parameter for insert query.
Ex:
router.attach(/{patient}/insertpatient, insertpatient);
I want to insert all the info about the patient using POST.
Or Search
Hi Dalia,
I am no expert, but I believe I can help you.
First off, I don't think you want to use insertpatient as part of your URL.
that's not very restful. Here is what I would recommend:
/patient - for creating (with POST), or searching (with GET)
/patient/{patientId} - for accessing a
I really have the same problem sooo any help plz
--
View this message in context:
http://restlet-discuss.1400322.n2.nabble.com/Unsupported-Media-Type-415-tp5963113p7451061.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.
I really have the same problem sooo any help plz
--
View this message in context:
http://restlet-discuss.1400322.n2.nabble.com/Unsupported-Media-Type-415-tp5963113p7451060.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.
Hi Jerome,
No worries, thanks for your response :-)
--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2702645
Hi Lads,
Could anyone give us some advice on this issue? It'd be really nice to get it
working.
Thanks :-)
--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2701930
I'm just after finding another thread which appears to have a similar problem
http://restlet.tigris.org/issues/show_bug.cgi?id=1219
There's no answer for it yet though.
Is anyone looking at this thread? It's been more than a week now since this
issue was posted?
Hi Bjorn,
Thanks very much for your help. Yes, in the mean time since I posted this
message I came to the same conclusion too, however, using plain java objects
with REST was really what was attracting me most with Restlet, so if I could
find a way to avoid using forms altogether it'd be very
My ContactServerResource is similar to the example:
@Get
public Contact retrieve(Contact contact) {
return contact;
}
@Put
public void store(Contact contact) {
ContactServerResource.contact = contact;
}
I am also a noob,
17 matches
Mail list logo