ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexWebSphere Message Broker SupportHTTPInput node is not creating message body whith DELETE

Post new topicReply to topic
HTTPInput node is not creating message body whith DELETE View previous topic :: View next topic
Author Message
agg
PostPosted: Fri Sep 02, 2016 1:26 am Post subject: HTTPInput node is not creating message body whith DELETE Reply with quote

Newbie

Joined: 02 Sep 2016
Posts: 2

HI all, this is my first POST. I hope to contribute soon.

Im trying to invoke an HTTPInput node (URI:/ delete) with method DELETE and a payload.

I have created a simple flow with an HTTPInput node and HTTPReply.

I have created a request with postman like this:

DELETE /delete HTTP/1.1
Host: myhost:7081
Content-Type: application/json
Cache-Control: no-cache

{
"myjsondata": "myjsonvalue"
}

HttpInputNode is not creating InputRoot.BLOB.BLOB, only creates properties and HTTPInputHeaders

However if the request is with method POST, to the same flow

POST/delete HTTP/1.1
Host: myhost:7081
Content-Type: application/json
Cache-Control: no-cache

{
"myjsondata": "myjsonvalue"
}

HttpInputNode creates InputRoot.properties, InputRoot.HTTPInputHeaders and InputRoot.BLOB.BLOB with the payload body.


anyone knows if it is posible to configure HTTInput node for allowing payload body with DELETE method?

could be a bug of HttpInput node? HTTP 1.1 specificatios allow body payload in DELETE method so HTTPInput node should treat it like a POST request? or do you think that is not permitted pass payload with DELETE method.

An alternative could be to use POST method for Post and Delete, including into the payload body a new value to know what to do in each case.


Thansk in Advance
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Sep 02, 2016 4:28 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

"The DELETE method requests that the origin server delete the resource
identified by the Request-URI.


I don't think it's possible to send a DELETE with a body. The above says that any data must be in the URI, not in a body.

So you'll have to do something like http://www.example.com/myjsondata/myjsonvalue
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
agg
PostPosted: Fri Sep 02, 2016 5:28 am Post subject: Reply with quote

Newbie

Joined: 02 Sep 2016
Posts: 2

Thanks for your quick response mqjeff .

Im agree with you but not at all.

My delete method really is not a physical delete, is logical delete, and I have to pass some comments about the delete reason (about 500 characters) so I think that is not a good idea to pass it through URL


In HTTP 1.1 spefification:
Bodies on DELETE requests have no defined semantics. Note that
sending a body on a DELETE request might cause some existing
implementations to reject the request.


I understand that is posible to send it, but same implementations, like message broker in this case, dont allow it.

Some tools for send request like POSTMAN and SOAPUI allow you to add body to a delete method, so this is possible and there are some case in which it will be appropriate.

Im going to use POST method instead of DELETE although not the most appropriate semantically but this option will solve the problem

Thanks again.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Sep 02, 2016 5:44 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

agg wrote:
Thanks for your quick response mqjeff .

Im agree with you but not at all.

My delete method really is not a physical delete, is logical delete,
So it should probably be a POST.
agg wrote:
In HTTP 1.1 spefification:
Bodies on DELETE requests have no defined semantics. Note that
sending a body on a DELETE request might cause some existing
implementations to reject the request.

Ah, you mean
[url=https://tools.ietf.org/html/rfc7231#page-29]A payload within a DELETE request message has no defined semantics;
sending a payload body on a DELETE request might cause some existing
implementations to reject the request.[/quote]

agg wrote:
I understand that is posible to send it, but same implementations, like message broker in this case, dont allow it.


Yeah, as mentioned in the spec - some implementations will reject the request.

agg wrote:
[Im going to use POST method instead of DELETE although not the most appropriate semantically but this option will solve the problem

That's the right thing, as far as I'm concerned. You're sending a logical request to delete, and very likely you want a response that indicates more than just "Yes, we've accepted your request to delete", i.e. an HTTP 200.

It may be that newer versions of Broker - v9, v10 - support bodies in delete requests.
But, again, I don't think that deletes give you back anything other than an HTTP Return code.
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
leron8
PostPosted: Tue Oct 25, 2016 3:08 pm Post subject: Reply with quote

Novice

Joined: 25 Oct 2016
Posts: 20
Location: MX

I would suggest you send that information in the headers, since you can create custom ones and retrieve the data from there.

InputRoot.HTTPInputHeader."MyHeader"
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker SupportHTTPInput node is not creating message body whith DELETE
Jump to:



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.