博文

目前显示的是标签为“http”的博文

Request Payload and Anuglar post

Reference:  How to send right format of payload in Angular 2 since the php backend accept only 'x-www-form-urlencoded'? http://stackoverflow.com/questions/38375791/how-to-send-right-format-of-payload-in-angular-2-since-the-php-backend-accept-on import { Http, Response,Headers, RequestOptions} from '@angular/http'; public getUserConfig():Observable<Response>{ let widgetUrl = '/api/getXConfig'; let data =encodeURI('jinData={"USERID":"Jin"}'); let options = new RequestOptions({ withCredentials: true }); var headers = new Headers(); // //headers.append('Content-Type', 'application/json'); //'application/x-www-form-urlencoded') can't send "Request Payload" //headers.append('Content-Type', 'application/x-www-form-urlencoded'); // headers.append('Content-Type', 'text/plain; charset=utf-8'); options.headers=headers; return this._http....

HTTP status code

List of HTTP status codes : http://en.wikipedia.org/wiki/List_of_HTTP_status_codes   1xx Informational   2xx Success   3xx Redirection   4xx Client Error   5xx Server Error java.net.HttpURLConnection.getResponseCode(): Gets the status code from an HTTP response message. For example: the following codes from w w w . c ode java. net/java-se/networking/use-httpurlconnection-to-download-file-from-an-http-url /*  * To change this license header, choose License Headers in Project Properties.  * To change this template file, choose Tools | Templates  * and open the template in the editor.  */ import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; /**  * A utility that downloads a file from a URL.  * @author www.codejava.net  */ public class HttpDownloadUtility {   ...