You did something wrong. That's all I can tell you based on what you posted.
We can't debug what we can't see.
Post your code that DOESN'T work!
It is just a string. There's nothing magic here. Paste together the parts you need to make the dynamic URL you want.
If you don't need to support ancient browsers, template literals are a handy way to paste together parts.
(ES6 syntax, all I use any more)
- const studentID = '37654';
- const operation = 'get';
- const url = `students/${operation}/${studentID}`;
Or if you have to support older browsers, use +.
None of this has anything to do with jQuery.