Using TRPC with Google's Place Details
Has anyone been able to properly set up a TRPC router with Google's Place Details API?
(https://developers.google.com/maps/documentation/places/web-service/place-details)
Doing the curl command from the link works fine, so it's something with the TRPC request (Status 400 HTTP error). I've also tried passing the parameters as headers in the
options
field to no avail
Google for Developers
Place Details (New) | Places API | Google for Developers
5 Replies
could post the specific error message? without it it's pretty difficult to debug anything
@Sturlen of course, apologies. Also to note, other third party routers set up similarly work without issue, so I suspect it's something that has to be different for Google
if google is sending a response in json, you might be able to log it when
!response.ok
and find more details:
this is just for debugging. in the long term you should probably return the data in the errorOkay, yeah that debugging helped. Thank you @Sturlen !
The error message from your debugging is:
I've never touched anything with language before. Adding
&languageCode=en
to the end of the apiUrl resolved the issue...so an error in Google's code since it is required after all and their default breaks the request?yeah that's an odd one. glad you figured it out though