Tutorial by Examples: client

a basic example for http client: write the follwing code in http_client.js file: var http = require('http'); var options = { hostname: '127.0.0.1', port: 80, path: '/', method: 'GET' }; var req = http.request(options, function(res) { console.log('STATUS: ' + res.statusCode)...
Uploading files can be easy or really complicated, depending on what you're wanting to do. In general, transfering a file itself isn't all that difficult. But there are lots of edge cases around attachments, binary files, and the like. And the real sticking point is horizontal scaling, and creating ...
In many instances, you will want to send data from the R server to the JS client. Here is a very simple example: library(shiny) runApp( list( ui = fluidPage( tags$script( "Shiny.addCustomMessageHandler('message', function(params) { alert(params); });" ), ...
Once you have your server side logging in place, it's time to hop over to the client side. If you haven't explored the console API, be prepared for a treat. There's actually all sorts of things that you can do with the built in Console API that's native to every Chrome and Safari installation. So mu...
POST /token HTTP/1.1 Host: server.example.com Content-Type: application/x-www-form-urlencoded grant_type=client_credentials&client_id=[APP_KEY]&client_secret=[APP_SECRET] Source
For testing our application, I'm using advance rest client which is chrome extension: So, here is the snapshot for inserting the data:
A cross-origin request must be sent including the Origin header. This indicates from where the request originated. For example, a cross-origin request from http://example.com to http://example.org would look like this: GET /cors HTTP/1.1 Host: example.org Origin: example.com The server will us...
Client.java import java.io.*; import java.net.*; public class Client{ public static void main(String [] args) throws IOException{ DatagramSocket clientSocket = new DatagramSocket(); InetAddress address = InetAddress.getByName(args[0]); String ex = "He...
Basic usage If the value of the href-attribute begins with mailto: it will try to open an email client on click: <a href="mailto:[email protected]">Send email</a> This will put the email address [email protected] as the recipient for the newly created email. Cc and ...
You should already have your backend REST resource available. On the client side (GWT) your need to Add RestyGwt dependency to your project with maven <dependency> <groupId>org.fusesource.restygwt</groupId> <artifactId>restygwt</artifactId> <vers...
To detect the environment on the server, we have to create a helper method on the server, as the server will determine which environment it is in, and then call the helper method from the client. Basically, we just relay the environment info from the server to the client. //------------------------...
As of Meteor 1.3, Meteor now exposes the NODE_ENV variable on the client by default. if (Meteor.isClient) { Meteor.startup(function () { if(process.env.NODE_ENV === "testing"){ console.log("In testing..."); } if(process.env.NODE_ENV === "production&...
If you want to integrate Meteor with an external API, it's likely that it's going to exposed as a REST interface. We tend to use the following Chrome apps for testing REST APIs. Postman DHC Rest Client Online tools: Hurl.it RequestBin
This is a TCP daytime client kept as simple as possible. #include <unistd.h> /* unix standard library */ #include <arpa/inet.h> /* IP addresses manipulation utilities */ #include <netinet/in.h> /* sockaddr_in structure definition */ #include <sys/socket.h> /* ber...
With IpRateLimit middleware you can set multiple limits for different scenarios like allowing an IP or IP range to make a maximum number of calls in a time interval like per second, 15 minutes, etc. You can define these limits to address all requests made to an API or you can scope the limits to eac...
With ClientRateLimit middleware you can set multiple limits for different scenarios like allowing a Client to make a maximum number of calls in a time interval like per second, 15 minutes, etc. You can define these limits to address all requests made to an API or you can scope the limits to each URL...
The only major differences between this and a regular TCP connection are the private Key and the public certificate that you’ll have to set into an option object. How to Create a Key and Certificate The first step in this security process is the creation of a private Key. And what is this private ...
In some instances, you will want to send data from JS client to the R server. Here is a basic example using javascript's Shiny.onInputChange function: library(shiny) runApp( list( ui = fluidPage( # create password input HTML('<input type="password" id="passw...
#!/usr/bin/env python """ An annotated simple socket client example in python. WARNING: This example doesn't show a very important aspect of TCP - TCP doesn't preserve message boundaries. Please refer to http://blog.stephencleary.com/2009/04/message-framing.html before adaptin...
Unity networking provides the High Level API (HLA) to handle network communications abstracting from low level implementations. In this example we will see how to create a Server that can communicate with one or multiple clients. The HLA allows us to easily serialize a class and send objects of ...

Page 2 of 5