on ‎2022 Nov 13 3:12 PM
Hello everyone,
I have this error 400 when I try to call my endpoint created with cap serivice with the jobscheduler.
I have followed the steps in this blog but I am getting the problem.
I have been investigating and it seems that in the call that makes the jobscheduler to my endpoint is not passing in the header the content type: application/json, If you look at the pictures I did the test with my postman and the same error appears if I remove the content type to the request, is there any way to add the content type: application/json in the call that makes the jobscheduler ?
If someone can give me a hand, it would be of great help.
Thanks in advance.


Request clarification before answering.
I have managed to solve the problem, basically in my definition of the service.cds I had an action associated to that endpoint which I called from the jobsechuler.
I have changed that action by a function since I didn't need to send any type of data to the service and I have configured it by means of the get call.
According to the documentation of the api if we declare an action, this will need a header application/json to be able to make the call since we will send data, in the body of the request. Then it is necessary to declare it. I don't know how to add that header using an action through the jobscheduler, but the only thing I could think of was to create a kind of midelware that would add the header forcing every time it enters in my api but I couldn't make it work. I think the Job Scheduler service is quite limited and should get some updates.
I hope you found my experience useful.
Best regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 8 | |
| 7 | |
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.