openbmc / phosphor-rest-server

REST server that transposes dbus interfaces to REST
Apache License 2.0
4 stars 11 forks source link

Add a convenient/short logout command #22

Closed williamli80 closed 8 years ago

williamli80 commented 8 years ago

With this patch, we can logout by: curl -c cjar -b cjar -k https://BMC/logout Traditional/json format logout is retained.

Signed-off-by: Nan Li bjlinan@cn.ibm.com


This change is Reviewable

bradbishop commented 8 years ago

I like what you are thinking here but we can’t do this. A good rule of thumb when deciding if something can be a GET rather than POST is if everything would continue to work if the client cached the reply, which for logout clearly isn’t the case.

One thing that can be fixed with logout is right now you are required to pass post data like this: ‘{“data”: []}’

It would be nice if we could get rid of that (but still do a post).

What I do to cut down on typing is create a .curlrc file and put all the options in there.

$cat ~/.curlrc

cookie = "/tmp/.cjar" cookie-jar = "/tmp/.cjar”

Thats all I have in mine but you can add the other options too. Check out the curl manpage.

williamspatrick commented 8 years ago

Closing per Brad's comments.