HTTP Methods: GET, POST, DELETE and PUT
HTTP Methods: GET, POST, DELETE and PUT
Topics: spring boot, http method, restful web service, rest web service, http get, http post, http put Source link
View On WordPress
seen from China
seen from China
seen from Brazil
seen from France
seen from United Kingdom

seen from Hong Kong SAR China
seen from Saudi Arabia
seen from Jordan
seen from China
seen from Netherlands
seen from Kazakhstan
seen from Yemen
seen from China
seen from United States
seen from Germany
seen from Belgium
seen from Italy
seen from United States
seen from Yemen
seen from Belgium
HTTP Methods: GET, POST, DELETE and PUT
HTTP Methods: GET, POST, DELETE and PUT
Topics: spring boot, http method, restful web service, rest web service, http get, http post, http put Source link
View On WordPress
Using Http services for storing and fetching user info: Angular 2
Using Http services for storing and fetching user info: Angular 2
Using Angular 2 Http get, post services is the most essential requirement when you are working on any Angular 2 app because anyhow you will have the scenario to store some user information from your end and you have to fetch some information from their end as well if you know what I mean.
So here in this blog, we are going to create an application in angular 2 which will use two services, one for…
View On WordPress
ESP32 / ESP8266 MicroPython: HTTP GET Requests
ESP32 / ESP8266 MicroPython: HTTP GET Requests
The objective of this post is to explain how to perform HTTP GET requests with MicroPython, using the urequests module. This tutorial was tested with MicroPython running on both the ESP32 and the ESP8266.
(more…)
View On WordPress
ESP32: HTTP GET Requests
ESP32: HTTP GET Requests
The objective of this post is to explain how to perform simple HTTP GET requests using the ESP32 and the Arduino environment. To do so, we will use the HTTPClient.h library.
(more…)
View On WordPress
JSONP and it's usages
JSONP and it’s usages
JSONP or “JSON with padding” is a communication technique used in JavaScript programs running in web browsers to request data from a server in a different domain, something prohibited by typical web browsers because of the same-origin policy. Wikipedia
The format JSONis a very lightweight for data-interchange. It was developed by “Douglas Crockford”, who is best known for the development of the…
View On WordPress
Difference between HTTP Methods - GET vs. POST
Difference between HTTP Methods – GET vs. POST
Almost everybody who’s been on the web has used HTML forms. These forms generally uses different HTTP Methods to communicate with server with user’s inputs. There are set of common methods defined by HTTP/1.1. Although this set can be expanded, additional methods cannot be assumed to share the same semantics for separately extended clients and servers. These method names are case sensitive and…
View On WordPress
Simple HTTP Request in Android
New Post has been published on http://droidstack.com/32/simple-http-request-in-android/
Simple HTTP Request in Android
In most of the android applications it is essential that app may need to connect to internet and make some HTTP requests. In this article i’ll be demonstrating about making simple HTTP Requests in android or java.
Creating HTTP Client and HTTP Post
// Creating HTTP client HttpClient httpClient = new DefaultHttpClient(); // Creating HTTP Post HttpPost httpPost = new HttpPost("http://www.droidstack.com/login");
Bulding Post Parameters The following code will create post parameters pair with key and value.
// Building post parameters, key and value pair List<NameValuePair> nameValuePair = new ArrayList<NameValuePair>(2); nameValuePair.add(new BasicNameValuePair("email", "[email protected]")); nameValuePair.add(new BasicNameValuePair("password", "123456"));
URL Encoding POST data Before making HTTP request you need to encode the post data in order to convert all string data into valid url format.
// Url Encoding the POST parameters try httpPost.setEntity(new UrlEncodedFormEntity(nameValuePair)); catch (UnsupportedEncodingException e) // writing error to Log e.printStackTrace();
Finally making HTTP Request Finally you need to execute httpPost using the httpClient created before.
// Making HTTP Request try HttpResponse response = httpClient.execute(httpPost); // writing response to log Log.d("Http Response:", response.toString()); catch (ClientProtocolException e) // writing exception to log e.printStackTrace(); catch (IOException e) // writing exception to log e.printStackTrace();
Final Code The following is the final code to make http Requests. I am writing response to log. Check your Log report in Eclipse to see your http response.
package com.droidstack.httprequests; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.List; import org.apache.http.HttpResponse; import org.apache.http.NameValuePair; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.HttpClient; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.HttpPost; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.message.BasicNameValuePair; import android.app.Activity; import android.os.Bundle; import android.util.Log; public class AndroidHTTPRequestsActivity extends Activity @Override public void onCreate(Bundle savedInstanceState) super.onCreate(savedInstanceState); setContentView(R.layout.main); // Creating HTTP client HttpClient httpClient = new DefaultHttpClient(); // Creating HTTP Post HttpPost httpPost = new HttpPost( "http://www.droidstack.com/login"); // Building post parameters // key and value pair List<NameValuePair> nameValuePair = new ArrayList<NameValuePair>(2); nameValuePair.add(new BasicNameValuePair("email", "[email protected]")); nameValuePair.add(new BasicNameValuePair("password", "123456")); // Url Encoding the POST parameters try httpPost.setEntity(new UrlEncodedFormEntity(nameValuePair)); catch (UnsupportedEncodingException e) // writing error to Log e.printStackTrace(); // Making HTTP Request try HttpResponse response = httpClient.execute(httpPost); // writing response to log Log.d("Http Response:", response.toString()); catch (ClientProtocolException e) // writing exception to log e.printStackTrace(); catch (IOException e) // writing exception to log e.printStackTrace();