All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.yubico.client.v2.HttpUtils Maven / Gradle / Ivy

Go to download

Client library written in Java for verifying Yubikey one-time passwords (OTPs) with validation protocol 2.

There is a newer version: 3.1.0
Show newest version
package com.yubico.client.v2;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.Map;

public class HttpUtils {
    public static String toQueryString(Map requestMap) throws UnsupportedEncodingException {
        String paramStr = "";
        for(Map.Entry entry : requestMap.entrySet()) {
            if(!paramStr.isEmpty()) {
                paramStr += "&";
            }
            paramStr += entry.getKey() + "=" + URLEncoder.encode(entry.getValue(), "UTF-8");
        }
        return paramStr;
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy