Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API

From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Lensflare18876208d@retoor no, both is not allowed. The api needs you to put the url params into the body if it‘s POST, otherwise you can put them into the url if it‘s GET or DELETE.
I haven‘t tried to always put them into the body but that‘s definitely unusual.
Url params belong in the url, not the body. They are encoded and escaped specifically for the url. I worked with a loooot of rest apis and never had one which required you to put url params into the body.
I have seen bad apis and good apis. DevRant isn‘t that bad but it definitely has some weird shit, like this one and the other one with the multitype value and the empty string, that I ranted about a few days ago. -
Lensflare18876208dAnother annoying thing:
The response of the notification feed has a structure with dynamic keys (inside of username_map).
Those keys are the ids of the users.
Now I can‘t use a proper type for this because the properties are not known. I need to use a dictionary with string keys instead.
Another problem is that the user ids are normally integers but in this structure they are strings because they are json keys.
This is normally solved by structuring it differently: using an array and moving the keys into values for the same key, so that you can decode it in a type.
*sigh* -
netikras34554208d@Lensflare you post data in body. You don't query, so query params make no sense. You post the data. In body
-
Lensflare18876208d@retoor
It‘s absolutely fine to have url parameters with POST requests, I don‘t know why the devrant api tries to avoid it. It also allows (or requires) url params for DELETE, so why not for POST?
It would be fine if the params in the body would be json encoded, but they are url encoded. That‘s the weird part.
I haven‘t tried to json encode them but url encoded does work. -
Lensflare18876208d@retoor ok my assumption that it requires url encoded params in the body might be wrong but I made this assumption for two reasons:
1. I stole it from OmerFlame
2. It works. Why would it work if it‘s not the intended way? 😅
That‘s a weird thing in itself.
Anyway thanks for letting me know that it works in any encoding.
But I stand by my point: There is nothing wrong in using url query params with POST, especially if you think that it‘s also ok for DELETE. -
netikras34554208d@Lensflare sure. But this is the pattern I've seen in many http client libs. And I think I saw it in rfc when I was trying to figure out why my http client won't allownpayloads for GET requests [ftr: not forbidden by rfc ;) ]
-
BURGEmona-6207dA RELIEF FOR CRYPTO SCAM VICTIMS THROUGH SYNACK HACKERS
I understand the frustration and stress associated with lost funds through investment scams. They got me and did away with almost half a million dollars. Luckily, I have some influences around who introduced me to an organization called Synack Hackers. As specialists in crypto recovery, the team of expert professionals is dedicated to helping individuals and businesses reclaim their lost money lost to investment scams. With their proven track record and exceptional customer service, they are the go-to company for fund recovery in Montreal and beyond. We were able to track them down and got the complete amount. Reach out to Synack Hackers via the following contact information.
Email: (synackhack{@}tech{-}center{.}com)
Related Rants
Another weird property of the devRant API:
For every POST request the url parameters need to be passed in the http body instead of in the URL, like this:
app=3&user_id=42
Wtf why?
devrant
api
url
params
post
rest