FAQ
Both Get and Post are exposed in a convenient way in net/http/client, but
to make requests with either Put or Delete you need to write lower- code. I
was wondering if it makes sense to add these two methods to
net/http/client? I haven't contributed before but this seems like a pretty
straightforward pair of commits that I would like to make, assuming there
isn't a reason keep them out of the client.

--

---
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Brad Fitzpatrick at Aug 29, 2013 at 12:17 am
    We drew the line at Get, Head, and Post.

    The line has to be drawn somewhere.

    Otherwise we'd have Options, Put, Patch, Delete, and Spacejump (
    http://www.onebigfluke.com/2013/08/lets-remove-verbs-from-http-20.html)


    On Wed, Aug 28, 2013 at 5:14 PM, Ben Mills wrote:

    Both Get and Post are exposed in a convenient way in net/http/client, but
    to make requests with either Put or Delete you need to write lower- code. I
    was wondering if it makes sense to add these two methods to
    net/http/client? I haven't contributed before but this seems like a pretty
    straightforward pair of commits that I would like to make, assuming there
    isn't a reason keep them out of the client.

    --

    ---
    You received this message because you are subscribed to the Google Groups
    "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Ben Mills at Aug 29, 2013 at 12:23 am
    I agree that it's unrealistic to support all verbs in the client. However I
    would argue that both Put and Delete are widely used enough that not
    supporting them results in projects not being able to take advantage of
    net/http/client at all if they need to use verbs beyond Get or Post. A
    great example of such project is a wrapper around a HTTP key value store
    like Riak that uses both verbs[1].

    [1] http://docs.basho.com/riak/latest/dev/references/http/store-object/
    On Wednesday, August 28, 2013, Brad Fitzpatrick wrote:

    We drew the line at Get, Head, and Post.

    The line has to be drawn somewhere.

    Otherwise we'd have Options, Put, Patch, Delete, and Spacejump (
    http://www.onebigfluke.com/2013/08/lets-remove-verbs-from-http-20.html)



    On Wed, Aug 28, 2013 at 5:14 PM, Ben Mills ({}, 'cvml', 'bmills.dev@gmail.com');>
    wrote:
    Both Get and Post are exposed in a convenient way in net/http/client, but
    to make requests with either Put or Delete you need to write lower- code. I
    was wondering if it makes sense to add these two methods to
    net/http/client? I haven't contributed before but this seems like a pretty
    straightforward pair of commits that I would like to make, assuming there
    isn't a reason keep them out of the client.

    --

    ---
    You received this message because you are subscribed to the Google Groups
    "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-dev+unsubscribe@googlegroups.com <javascript:_e({},
    'cvml', 'golang-dev%2Bunsubscribe@googlegroups.com');>.
    For more options, visit https://groups.google.com/groups/opt_out.
    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Brad Fitzpatrick at Aug 29, 2013 at 12:30 am
    Argument heard.

    But at a certain point people need to write code.

    Even if we provided, say:

    1) a top-level func DoRequest(*Request), like the http.(*Client).Do, but
    working on the DefaultClient like Get, Head, and Post.
    2) a top-level func DoRequest(method, url string, header Header, body
    io.ReadCloser)

    ... then people would find even more stuff (e.g. timeouts) that they'd want
    in the funcs, rather than just calling two funcs in a row and composing
    stuff together.

    Also:
    not supporting them results in projects not being able to take advantage
    of net/http/client at all if they need to use verbs

    If somebody can't write a Riak client with net/http, I'd be very reluctant
    to use that person's Riak client in any language.


    On Wed, Aug 28, 2013 at 5:23 PM, Ben Mills wrote:

    I agree that it's unrealistic to support all verbs in the client. However
    I would argue that both Put and Delete are widely used enough that not
    supporting them results in projects not being able to take advantage of
    net/http/client at all if they need to use verbs beyond Get or Post. A
    great example of such project is a wrapper around a HTTP key value store
    like Riak that uses both verbs[1].

    [1] http://docs.basho.com/riak/latest/dev/references/http/store-object/

    On Wednesday, August 28, 2013, Brad Fitzpatrick wrote:

    We drew the line at Get, Head, and Post.

    The line has to be drawn somewhere.

    Otherwise we'd have Options, Put, Patch, Delete, and Spacejump (
    http://www.onebigfluke.com/2013/08/lets-remove-verbs-from-http-20.html)


    On Wed, Aug 28, 2013 at 5:14 PM, Ben Mills wrote:

    Both Get and Post are exposed in a convenient way in net/http/client,
    but to make requests with either Put or Delete you need to write lower-
    code. I was wondering if it makes sense to add these two methods to
    net/http/client? I haven't contributed before but this seems like a pretty
    straightforward pair of commits that I would like to make, assuming there
    isn't a reason keep them out of the client.

    --

    ---
    You received this message because you are subscribed to the Google
    Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Ben Mills at Aug 29, 2013 at 12:44 am
    Fair points. I still feel its arbitrary that net/http/client supports only
    Get, Post, and Head. However it's clear there is resistance to adding
    additional verbs to the client so I'll move on.
    On Wednesday, August 28, 2013, Brad Fitzpatrick wrote:

    Argument heard.

    But at a certain point people need to write code.

    Even if we provided, say:

    1) a top-level func DoRequest(*Request), like the http.(*Client).Do, but
    working on the DefaultClient like Get, Head, and Post.
    2) a top-level func DoRequest(method, url string, header Header, body
    io.ReadCloser)

    ... then people would find even more stuff (e.g. timeouts) that they'd
    want in the funcs, rather than just calling two funcs in a row and
    composing stuff together.

    Also:
    not supporting them results in projects not being able to take advantage
    of net/http/client at all if they need to use verbs

    If somebody can't write a Riak client with net/http, I'd be very reluctant
    to use that person's Riak client in any language.


    On Wed, Aug 28, 2013 at 5:23 PM, Ben Mills wrote:

    I agree that it's unrealistic to support all verbs in the client. However
    I would argue that both Put and Delete are widely used enough that not
    supporting them results in projects not being able to take advantage of
    net/http/client at all if they need to use verbs beyond Get or Post. A
    great example of such project is a wrapper around a HTTP key value store
    like Riak that uses both verbs[1].

    [1] http://docs.basho.com/riak/latest/dev/references/http/store-object/

    On Wednesday, August 28, 2013, Brad Fitzpatrick wrote:

    We drew the line at Get, Head, and Post.

    The line has to be drawn somewhere.

    Otherwise we'd have Options, Put, Patch, Delete, and Spacejump (
    http://www.onebigfluke.com/2013/08/lets-remove-verbs-from-http-20.html)


    On Wed, Aug 28, 2013 at 5:14 PM, Ben Mills wrote:

    Both Get and Post are exposed in a convenient way in net/http/client,
    but to make requests with either Put or Delete you need to write lower-
    code. I was wondering if it makes sense to add these two methods to
    net/http/client? I haven't contributed before but this seems like a pretty
    straightforward pair of commits that I would like to make, assuming there
    isn't a reason keep them out of the client.

    --

    ---
    You received this message because you are subscribed to the Google
    Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Brad Fitzpatrick at Aug 29, 2013 at 12:52 am
    It _is_ arbitrary.

    There are an unbounded number of possible HTTP methods. Drawing the line
    at any more than zero (be it 3, 4 or 7) is arbitrary.

    The only non-arbitrary decision would be to remove the helpers and force
    everybody to do it the lower-level way, but a) that wouldn't be friendly to
    most cases (arbitrary), and b) we can't anyway, due to Go 1 API
    compatibility.


    On Wed, Aug 28, 2013 at 5:44 PM, Ben Mills wrote:

    Fair points. I still feel its arbitrary that net/http/client supports only
    Get, Post, and Head. However it's clear there is resistance to adding
    additional verbs to the client so I'll move on.
    On Wednesday, August 28, 2013, Brad Fitzpatrick wrote:

    Argument heard.

    But at a certain point people need to write code.

    Even if we provided, say:

    1) a top-level func DoRequest(*Request), like the http.(*Client).Do, but
    working on the DefaultClient like Get, Head, and Post.
    2) a top-level func DoRequest(method, url string, header Header, body
    io.ReadCloser)

    ... then people would find even more stuff (e.g. timeouts) that they'd
    want in the funcs, rather than just calling two funcs in a row and
    composing stuff together.

    Also:
    not supporting them results in projects not being able to take
    advantage of net/http/client at all if they need to use verbs

    If somebody can't write a Riak client with net/http, I'd be very
    reluctant to use that person's Riak client in any language.


    On Wed, Aug 28, 2013 at 5:23 PM, Ben Mills wrote:

    I agree that it's unrealistic to support all verbs in the client.
    However I would argue that both Put and Delete are widely used enough that
    not supporting them results in projects not being able to take advantage of
    net/http/client at all if they need to use verbs beyond Get or Post. A
    great example of such project is a wrapper around a HTTP key value store
    like Riak that uses both verbs[1].

    [1] http://docs.basho.com/riak/latest/dev/references/http/store-object/

    On Wednesday, August 28, 2013, Brad Fitzpatrick wrote:

    We drew the line at Get, Head, and Post.

    The line has to be drawn somewhere.

    Otherwise we'd have Options, Put, Patch, Delete, and Spacejump (
    http://www.onebigfluke.com/2013/08/lets-remove-verbs-from-http-20.html)


    On Wed, Aug 28, 2013 at 5:14 PM, Ben Mills wrote:

    Both Get and Post are exposed in a convenient way in net/http/client,
    but to make requests with either Put or Delete you need to write lower-
    code. I was wondering if it makes sense to add these two methods to
    net/http/client? I haven't contributed before but this seems like a pretty
    straightforward pair of commits that I would like to make, assuming there
    isn't a reason keep them out of the client.

    --

    ---
    You received this message because you are subscribed to the Google
    Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedAug 29, '13 at 12:16a
activeAug 29, '13 at 12:52a
posts6
users3
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase