package main

import (
	"fmt"
	"net/http"
)

func SupportRequestType(got string, need string, w http.ResponseWriter) bool {
	if need == "" {
		need = "GET"
	}
	if got != need {
		fmt.Fprintf(w, "method %v is not supported, only %v", got, need)
	}
	return got == need
}
func typeJson(w http.ResponseWriter) { 
	w.Header().Set("Content-Type", "application/json")
}

func allowCors(w http.ResponseWriter){
	w.Header().Set("Access-Control-Allow-Origin", "*")
	w.Header().Set("Access-Control-Allow-Headers", "Content-Type")
}