How to send a https request with a certificate golang

You need to add CA of your certificate to your transport like: package main import ( “crypto/tls” “io/ioutil” “log” “net/http” “crypto/x509” ) func main() { caCert, err := ioutil.ReadFile(“rootCA.crt”) if err != nil { log.Fatal(err) } caCertPool := x509.NewCertPool() caCertPool.AppendCertsFromPEM(caCert) client := &http.Client{ Transport: &http.Transport{ TLSClientConfig: &tls.Config{ RootCAs: caCertPool, }, }, } _, err := … Read more

how to create an issue in jira via rest api?

POST to this URL https://<JIRA_HOST>/rest/api/2/issue/ This data: { “fields”: { “project”: { “key”: “<PROJECT_KEY>” }, “summary”: “REST EXAMPLE”, “description”: “Creating an issue via REST API”, “issuetype”: { “name”: “Bug” } } } In received answer will be ID and key of your ISSUE: {“id”:”83336″,”key”:”PROJECT_KEY-4″,”self”:”https://<JIRA_HOST>/rest/api/2/issue/83336″} Don’t forget about authorization. I used HTTP-Basic one.

HTTP headers “Accept” and “Content-Type” in a REST context

The difference can be found in the specifications, in this case RFC 7231: 5.3.2. Accept The “Accept” header field can be used by user agents to specify response media types that are acceptable. Content-Type The “Content-Type” header field indicates the media type of the associated representation The Accept header always indicates what kind of … Read more


Few things to be clarified here are: GET /?service=turn&username=mbzrxpgjys which returns a JSON, is just a suggested uri for retrieving time-limited TURN credentials from the server, you do not have to follow that, your uri can be just /?giveMeCredentials. In fact, I use my socket connection to retrieve this data, not direct http call with … Read more

What is the difference between API Gateway and ESB?

An API Gateway is a proxy provided for the client. The Gateway gives the client a consistent interface regardless of any changes within the internal system. It allows the internal system to change without affecting the client. The API Gateway can also provide consistent cross-cutting concerns such as security logging, reporting and API analytics. An … Read more

RESTful POSTS, do you POST objects to the singular or plural Uri?

Since POST is an “append” operation, it might be more Englishy to POST to /products, as you’d be appending a new product to the existing list of products. As long as you’ve standardized on something within your API, I think that’s good enough. Since REST APIs should be hypertext-driven, the URI is relatively inconsequential anyway. … Read more