I am setting up some endpoints for our customers to use. They want to both send data into Appfarm and get them out again.
I would like to set up two endpoints, one GET and one PATCH, for certain objects, so that the url is equal but the methods have slightly different logic, as one would expect. I see two ways I could do that in Appfarm, but I’m getting errors on both:
Either I could set up one endpoint that is accessible with several methods. The problem here is that it looks like I cannot set up any logic on which method the end user uses? I would expect to see fx method under fx Built-in Service Variable or Context Params, but I see no such thing. Is there any possibility for me to see which method is used?
The other way I imagine to solve this issue is to set up two endpoints, one for the get and one for the patch, with the same url. I see that I get a warning in create if I set the two endpoint to accept the same method, which makes sense. No warning when I set them to be different. However, I get this error when running the GET endpoint:
"message": "Cannot redefine property: headers",
Is this an Appfarm error? Or something I have set up wrong? The only header I have created is a token to get access to the right company, but that is equal for the two endpoints, the only difference is the method.