This file contains hidden or 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 ballerina/http; | |
listener http:Listener helloWorldEP = new(9095, config = { httpVersion: "2.0" }); | |
service hello on helloWorldEP { | |
resource function sayHello(http:Caller caller, http:Request req) { | |
// Send a Push Promises for 2 resources with 2 methods. | |
http:PushPromise promise1 = new(path = "/resource1", method = "GET"); |
This file contains hidden or 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 ballerina/http; | |
import ballerina/log; | |
http:Client clientEP = new("http://localhost:9095", config = { httpVersion: "2.0" }); | |
public function main() { | |
// Submit a `GET` request. | |
http:Request serviceReq = new; | |
http:HttpFuture httpFuture = checkpanic clientEP->submit("GET", "/hello/sayHello", serviceReq); |
This file contains hidden or 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 ballerina/config; | |
import ballerina/http; | |
import ballerina/io; | |
import ballerina/log; | |
import wso2/github4; | |
endpoint github4:Client githubClient { | |
clientConfig: { | |
auth: { | |
scheme: http:OAUTH2, |
This file contains hidden or 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
# Build tool files | |
.gradle/ | |
.mvn/ | |
/out | |
/build | |
node_modules/ | |
# Compiled class file | |
*.class |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"log" | |
"net/http" | |
) | |
func main() { |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"golang.org/x/net/http2" | |
"io/ioutil" | |
"log" | |
"net/http" | |
) |
This file contains hidden or 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
package main | |
import ( | |
"bytes" | |
"crypto/tls" | |
"crypto/x509" | |
"fmt" | |
"io/ioutil" | |
"log" | |
"net/http" |
This file contains hidden or 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
package main | |
import ( | |
"bytes" | |
"crypto/tls" | |
"crypto/x509" | |
"fmt" | |
"golang.org/x/net/http2" | |
"io/ioutil" | |
"log" |
This file contains hidden or 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 ballerina/encoding; | |
import ballerina/http; | |
# The Twitter client object. | |
public type Client client object { | |
http:Client twitterClient; | |
Credential twitterCredential; | |
public function __init(Configuration twitterConfig) { |
This file contains hidden or 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 ballerina/io; | |
import ballerina/test; | |
Configuration twitterConfig = { | |
consumerKey: "Twitter App Consumer Key", | |
consumerSecret: "Twitter App Consumer Secret", | |
accessToken: "Twitter App Access Token", | |
accessTokenSecret: "Twitter App Access Token Secret", | |
}; | |
Client twitterClient = new(twitterConfig); |