binalyze/httpreq

Support query parameters

yakuter opened this issue ยท 11 comments

We need to support query parameters. To do this we need a method like SetParam(params map[string]interface{}). Then this method will add the keys and values as query parameters to the requests.

I can take this part on myself.

Thank you @muratmirgun. I assigned you.

Would it be a problem in this function if we set the query parameter type as SetParam(params map[string]string) ?

It means we leave the responsibility to the user to convert numbers to string. Well I think this is ok for now. We can use map[string]string

Can I also work on this feature? Sorry, I am asking this, because I am new to open source stuff.

No problem @betelgeuse-7. Asking is a nice thing ;)

Unfortunately we already assigned @muratmirgun for this job. You should look for issues which not assigned for anybody.

Thank you. I will be looking for other issues then.
I forked this repository and pushed my implementation of SetParam to it. I will consider this as my first open source contribution :).

I just checked it @betelgeuse-7 and it is nice. @muratmirgun you shoul also have a look at it:

betelgeuse-7@f499c45

This addition seems a bit too much. Transactions over the URL may cause problems, I think, it would be logical to use it when there is a ready-made URL package. For example: https://github.com/muratmirgun/httpreq/blob/1b189fe5747431b926c3d6d0c4d3b66339e623e7/request.go#L157
I have to write a test.

Ohhh yes, I didn't look at the code in detail. It is very dangerous to build URL yourself.

I saw your PR @muratmirgun. Waiting for you to add test and fix conflict in request.go.

Closed with #10