TrailAPI

फ्रीमियम
द्वारा trailapi | अपडेट किया गया 5日前 | Travel
लोकप्रियता

9.3 / 10

लेटेंसी

1,061ms

सेवा का स्तर

100%

Health Check

N/A

सभी चर्चाओं पर वापस जाएं

Internal Server Erorr; Status: 500

Rapid account: Exo
exo
1年前
Hello - I'm trying to connect to the api but the javascript fetch function returns an internal server error code 500. Can you we verify the state of the TrailAPI before I continue?
```
API Response : 
index.html:34    
    
   GET https://trailapi-trailapi.p.rapidapi.com/trails/explore/?lat=39.7551&lon=-75.5291 500

(anonymous) @ index.html:34
index.html:36 {code: ‘internal_server_error’, message: ‘<p>There has been a critical error on this website…arn more about troubleshooting WordPress.</a></p>’, data: {…}, additional_errors: Array(0)}additional_errors: []code: "internal_server_error"data: {status: 500}message: “<p>There has been a critical error on this website.</p><p><a href=“https://wordpress.org/support/article/faq-troubleshooting/”>Learn more about troubleshooting WordPress.</a></p>”[[Prototype]]: Object

---------------------------------------------------------------------------------------------------
My <script> block: 
```	<script>
function getInputValue() {
	var inputVal = document.getElementById("searchText").value;
	console.log(inputVal)
}
var lat;
var long;
document.getElementById("search").addEventListener("click", ()=> {
	navigator.geolocation.getCurrentPosition((position) => {
		let lat = position.coords.latitude;
		let long = position.coords.longitude;

		console.log(lat + "," + long);
	
const options = {
	method: 'GET',
	headers: {
		'X-RapidAPI-Key': '06c6d67a50mshe8ad2b792c799e9p150051jsn9808f6b7a8df',
		'X-RapidAPI-Host': 'trailapi-trailapi.p.rapidapi.com'
	}
};

fetch('https://trailapi-trailapi.p.rapidapi.com/trails/explore/?lat=39.7551&lon=-75.5291', options)
	.then(response => response.json())
	.then(response => console.log(response))
	//.catch(err, console.error(error));

});
})


	</script>
	```
Any help is greatly appreciated; thank you.
Rapid account: Trailapi
trailapi Commented 1年前

Hi there, thanks for the note. This should be working now, please let us know if not.

Cheers!

चर्चा में शामिल हों - नीचे टिप्पणी जोड़ें:

नई टिप्पणियाँ पोस्ट करने के लिए लॉग इन / साइनअप करें