Enhancement (DELETE) and Bug fixes (around POST response)

1. In fetch(), the check for negative response to raise HALNavigatorError,
       if raise_exc and not self.response:
            raise HALNavigatorError(self.response.text,
                                    status=self.status,
                                    nav=self,
                                    response=self.response,
            )    
   Is not too late in the flow?. I feel it should be checked before processing the response body 

2. PostResponse can have properties, hence implemented __call__ to return properties

3. DELETE method is similar to POST from Navigator perspective (non-idempotent) 
  Hence,
         a) Reused logic from POST to implement support for DELETE
         b) renamed PostResponse to HALResponse 
         c) renamed  create() to post() for clarity
   In order to provide backward compatibility, I created alias "create"  to "post"

4. HALNavigator should not allow POST if the uri is templated. The check for templated_uri 
   was missing. Created a wrapper function (@template_uri_check) to re-use for all methods - GET/POST/DELETE

TODO:
1. Enforce templated_uri check for all HTTP calls. Add test coverage 
2. a link usually have 'method' property (default to 'GET'), which can be used to restrict http operations. this helps to raise NotImplementedError and can have a controlled default function e.g autofetch
I was about to say, why can't we name it other way around create = post. By
reading ur comments on delete/put, I am thinking.... I see benefit in both
ways. As they are standard method names and being a tool that deal with raw
http requests it should follow naming convention which everyone is familiar
with. Same time I agree your idea to force ppl to think in right way. I
would buy 100% if we are developing an application. I see this as tool that
helps to build an  application, hence struggling to buy this thought. I
have seen some implementation using PUT as create :) I know it is not
right. However as a consumer of such implementation one would  have less
control over the naming, and forcing them to think create as  POST is not
good. I would like to hear more from you on this though
On 31 Oct 2014 08:32, "Josh Kuhn" <notifications@github.com> wrote:

> In restnavigator/halnav.py:
>
> > @@ -270,14 +296,79 @@ def create(self,
> >                  nav=self,
> >                  response=response,
> >              )
> > +        return response
> > +
> > +    @template_uri_check
> > +    #@method_validation(allowed_list=['POST'])
> > +    def post(self,
>
> I don't like renaming create to post. POST has a long history on the web
> of meaning "whatever doesn't fit into one of the other methods". I strongly
> think it should be called create in rest_navigator so people feel weird
> when they do something that isn't conceptually creating a new resource with
> it.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/deontologician/rest_navigator/pull/8/files#r19656135>.
>