Naming methods that perform HTTP GET/POST calls?
Posted
by
antonpug
on Programmers
See other posts from Programmers
or by antonpug
Published on 2013-11-04T13:04:35Z
Indexed on
2013/11/04
16:10 UTC
Read the original article
Hit count: 304
In the application I am currently working on, there are generally 3 types of HTTP calls:
- pure GETs
- pure POSTs (updating the model with new data)
- "GET" POSTs (posting down an object to get some data back, no updates to the model)
In the integration service, generally we name methods that post "postSomething()", and methods that get, "getSomething()".
So my question is, if we have a "GET" POST, should the method be called:
- getSomething - seeing as the purpose is to obtain data
- postSomething - since we are technically using POST
- performSomeAction - arbitrary name that's more relevant to the action
What are everyone's thoughts?
© Programmers or respective owner