Java URL Parameter Builder parseResponseParams(String body)

Here you can find the source of parseResponseParams(String body)

Description

parse Response Params

License

Open Source License

Declaration

public static HashMap<String, String> parseResponseParams(String body)
            throws Exception 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.net.*;
import java.util.HashMap;

public class Main {
    public static HashMap<String, String> parseResponseParams(String body)
            throws Exception {

        HashMap<String, String> results = new HashMap<String, String>();
        for (String keyValuePair : body.split("&")) {
            String[] kvp = keyValuePair.split("=");
            results.put(kvp[0], URLDecoder.decode(kvp[1], "UTF-8"));
        }/*from  w w w  . j  a va 2s .  c o m*/
        return results;

    }
}

Related

  1. mapToString(Map map)
  2. parse(final Map> parameters, final Scanner scanner, final String encoding)
  3. parse_parameters(String input)
  4. parseGetParameters(HttpExchange exchange)
  5. parseParameters(final String value)
  6. sendGetRequest(String path, Map params, String enc)
  7. sendPostRequest(String path, Map params, String enc)
  8. serializeParameters(final Map parameters)
  9. serializeParameters(final Map params)