Open Croge32 opened 7 years ago
I was also curious if there was a way I could get the request JSON that spine serializes out for debugging purposes?
I think this is currently not possible in Spine. What you can do is POST it to /v1/energy_assessments
. If you assign a user to the user
property, Spine should include the id of this user in the payload under the relationships
key.
You can log all the network requests by setting the log level to debug: Spine.setLogLevel(.debug, forDomain: .networking)
. This will include the POST body as well.
I found a sort of hack solution by changing the base URL for the particular request to include /user{id} and the request works for me.
Hello,
I was wondering how I'd go about posting to a resource that belongs to another resource?
We have endpoints for a user at
v1/users
and for an energy assessment at/v1/users/{id}/energy_assessment
My POST to users works fine, but I'm struggling to POST to the energy assessment.
My EnergyAssessment object:
And my API helper method:
And it should be noted that Spine was initialized with a baseURL that looks like
https://myurl.com/v1
Any advice?