Yes, that is a very common beginner mistake. Sometimes a little copy-pasta is needed to avoid over-complicating what needs to be simple.
Where DRY is really important are things like:
- Hey, you seem to be using "foo" and "bar" all over the place. Put those strings in constants.
- Hey, you're using magic numbers all over the place. Use an enum (or constants depending on your language / situation.)
- Wow, you copied and pasted that logic all over the place. Now when we need to make a change we have to make it in 20 spots. That should be encapsulated in a function / method / object
- (And to get closer to home) Even though you just want to "send a POST request with a single JSON object," we have a common session management pattern and error handling pattern in our application to deal with this API. That particular pattern should be encapsulated so you aren't repeating it for every #%$#@ API request.