# HTTP API problems

**URL:** <https://community.stardog.com/t/http-api-problems/1113>\
**Category:** Support\
**Created:** [June 28, 2018, 5:09pm UTC](https://community.stardog.com/t/http-api-problems/1113 "2018-06-28T17:09:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![w3sunrui1](https://avatars.discourse-cdn.com/v4/letter/w/77aa72/32.png) [@w3sunrui1](https://community.stardog.com/u/w3sunrui1)\
**Post date:** [June 28, 2018, 5:09pm UTC](https://community.stardog.com/t/http-api-problems/1113/1 "2018-06-28T17:09:36Z")

</div>

When i try to use the HTTP API to query data from Stardog , the response is that " 400 Bad Request  
{“message”:"No separator character found in the URI: "} ". I request Stardog server by Golang programming language. That problem also appeared by CURL way.

Code:

```
package main

import (
	"bytes"
	"fmt"
	"io/ioutil"
	"net/http"
)

func main() {
	client := &http.Client{}

	body := []byte("query=SELECT ?x { ?x ?p ?o }")

	req, _ := http.NewRequest("GET", "http://0.0.0.0:5820/pizza/query?query=&baseURI=&limit=&offset=&timeout=", bytes.NewBuffer(body))

	req.Header.Add("Accept", "text/turtle, application/rdf+xml, application/n-triples, application/trig, application/n-quads, text/n3, application/trix, application/ld+json, application/sparql-results+xml, application/sparql-results+json, application/x-binary-rdf-results-table, text/boolean, text/csv, text/tsv, text/tab-separated-values")

	resp, err := client.Do(req)

	if err != nil {
		fmt.Println("Errored when sending request to the server")
		return
	}

	defer resp.Body.Close()
	resp_body, _ := ioutil.ReadAll(resp.Body)

	fmt.Println(resp.Status)
	fmt.Println(string(resp_body))
}
```

---

<div class="post-metadata">

**Author:** ![zachary.whitley](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/zachary.whitley/32/94_2.png) [@zachary.whitley](https://community.stardog.com/u/zachary.whitley)\
**Post date:** [June 28, 2018, 6:06pm UTC](https://community.stardog.com/t/http-api-problems/1113/2 "2018-06-28T18:06:28Z")

</div>

Maybe http/net already does it for you but you might need to percent encode your query.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/2X/e/ed66b48a616f505106a4acde3c9cee7e6da9bc67.svg) [@system](https://community.stardog.com/u/system)\
**Post date:** [July 12, 2018, 6:06pm UTC](https://community.stardog.com/t/http-api-problems/1113/3 "2018-07-12T18:06:34Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
