This site is being rebuilt and some pages are out of date. For current details, write to [email protected]. This notice goes away when the rebuild is done.

No analytics unless you allow it, no tracking. This site keeps in your browser the language you pick, the theme, its colour, which site you chose, the currency on the pricing page and that you closed this notice; signing in adds session cookies. The legal page has the details.

Sign in

Radar · Go · Archive · Week 35 · Aug 24 – 30, 2026

net/http: add MethodQuery constant

Worth knowingstdlib

What changed
The standard library now defines const MethodQuery = "QUERY" in net/http/method.go.
Production impact
The source does not say.
Try it
Import net/http and print http.MethodQuery to verify the new constant.
Source
github.com/golang/go/issues/80058

Understand it, then run it

The HTTP protocol has a method called QUERY that lets a client send a large or binary request body while still keeping the request safe and idempotent. The Go standard library now defines a constant for this method: MethodQuery = "QUERY". Before this change you could not refer to the method by a predefined name; you would have to type the string yourself. With the new constant you can write http.MethodQuery instead of "QUERY".

Run it now

Todaygo
// This program demonstrates that http.MethodQuery is not defined in Go 1.27.1.
// It uses the literal string "QUERY" instead, which is the value that will be
// added to the standard library in a future release.
package main

import (
	"fmt"
	"net/http"
)

func main() {
	// Use the literal method name that will become http.MethodQuery later.
	req, err := http.NewRequest("QUERY", "https://example.com", nil)
	if err != nil {
		panic(err)
	}
	fmt.Println("Method:", req.Method) // prints: QUERY
}

What it printed when we ran it on Go 1.27.1

Method: QUERY

Run sends this program (for Solidity, the contract and its tests) to our own sandbox, where it is compiled and run once, with no network, and what it printed or the test report comes back here. Nothing is kept. Runs are counted per visitor for the day so everyone gets a turn; the details are on the legal page.

Written by gpt-oss-20b from the linked source · claims checked against the sources · archive, not individually reviewed