- When in doubt, use
.send()
. It dynamically setsContent-Type
headers to match the data it sends. - When sending JSON, you can either use
.json()
or.send()
..json()
is likely less confusing.json()
uses.send()
under the hood so the resulting HTTP headers are the same.
- Initialized ExpressJS project as per this gist
project-root
├── node_modules
├── package-lock.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useEffect } from "react"; | |
import { | |
StyleSheet, | |
Text, | |
View, | |
ActivityIndicator, | |
Alert, | |
Button, | |
} from "react-native"; | |
import * as Location from "expo-location"; |