메일 중복 검사

Request

GET https://api.solapi.com/users/v1/existence/email/:email

특정 메일을 사용하고 있는 사용자가 있는지 확인합니다.

Path Parameters

Name

Description

:email

이메일

Samples

existenceEmail.spec.js

Sample Request

http://api.solapi.com/users/v1/existence/email/[email protected]

Sample Response

{
"email": "[email protected]",
"result": true
}

Sample Code

NODE
PHP
PYTHON
CURL
RUBY
GO
JAVA
NODE
var request = require('request');
var options = {
method: 'GET',
json: true,
url: 'http://api.solapi.com/users/v1/existence/email/[email protected]'
};
request(options, function(error, response, body) {
if (error) throw error;
console.log('result :', body);
});
PHP
<?php
$url = "http://api.solapi.com/users/v1/existence/email/[email protected]";
$options = array(
'http' => array(
'header' => ,
'method' => 'GET'
)
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
var_dump($result);
PYTHON
import requests
url = "http://api.solapi.com/users/v1/existence/email/[email protected]"
response = requests.get(url)
print(response.status_code)
print(response.text)
CURL
#!/bin/bash
curl -X GET \
http://api.solapi.com/users/v1/existence/email/[email protected]
RUBY
require 'net/http'
require 'uri'
require 'json'
uri = URI.parse("http://api.solapi.com/users/v1/existence/email/[email protected]")
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.request_uri, )
response = http.request(request)
puts response.code
puts response.body
GO
package main
import (
"fmt"
"io/ioutil"
"net/http"
"strings"
)
func main() {
uri := "http://api.solapi.com/users/v1/existence/email/[email protected]"
req, err := http.NewRequest("GET", uri, nil)
if err != nil { panic(err) }
client := &http.Client{}
resp, err := client.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
bytes, _ := ioutil.ReadAll(resp.Body)
str := string(bytes)
fmt.Println(str)
}
JAVA
package solapi;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
public class Request {
public static void main(String[] args) throws Exception {
String targetUrl = "http://api.solapi.com/users/v1/existence/email/[email protected]";
URL url = new URL(targetUrl);
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("GET");
con.setDoOutput(true);
DataOutputStream wr = new DataOutputStream(con.getOutputStream());
wr.writeBytes(parameters);
wr.flush();
wr.close();
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
String line;
StringBuffer response = new StringBuffer();
while ((line = in.readLine()) != null) {
response.append(line);
}
in.close();
System.out.println("HTTP response code : " + responseCode);
System.out.println("HTTP body : " + response.toString());
}
}

문서 생성일 : 2020-09-23