728x90
반응형
Insomnia는 오픈소스 API 클라이언트 로 여러 API 를 테스트할 수 있는 툴이다.
나는 이 툴을 애용하는데, SOUP API를 테스트하고 싶어서 그 방법을 알아보고자 한다!
테스트하려는 API는 넥슨의 메이플스토리에서 제공하는 API다. 아래 페이지의 SOUP 1.1 GetInspecttoinInfo POST API를 테스트해본다.
API : http://api.maplestory.nexon.com/soap/maplestory.asmx?op=GetInspectionInfo
해당 페이지에서 제공하는 API 정보는 다음 사진과 같다
1. HOST와 POST 주소를 합친 값을 주소에 삽입
POST /soap/maplestory.asmx HTTP/1.1
Host: api.maplestory.nexon.com
➡ http://api.maplestory.nexon.com/soap/maplestory.asmx
2. 전달값의 유형을 XML로 변경
3. Headers 에 Content-Type 을 text/xml; charset=utf-8 로 설정
4. 전달값에 XML 내용을 복사하여 붙임
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetInspectionInfo xmlns="https://api.maplestory.nexon.com/soap/" />
</soap:Body>
</soap:Envelope>
이 때, 이 API는 따로 작성할 Input이 없지만 Input이 있는 경우 태그에 내용 작성해야함. 이 예시는 게시물 하단에 있다.
5. Send 를 클릭하면 API가 정상적으로 호출되는 것을 볼 수 있다.
Input이 있는 경우는 다음 사진과 같이 작성하면 된다.
API : http://api.maplestory.nexon.com/soap/maplestory.asmx?op=GetCharacterInfoByAccountID
해당 페이지에서 제공하는 API 정보는 다음 사진과 같다
SOUP 1.1 GetCharacterInfoByAccountID POST API로 Account 라는 Input이 필요하여 임의로 값을 넣어 테스트한 화면이다.
728x90
반응형
'IT' 카테고리의 다른 글
windows에서 git쓰다가 마주한 문제 해결 과정 (0) | 2023.06.02 |
---|---|
MYSQL 접속, DB생성, 덤프 명령어 (0) | 2023.03.03 |
MYSQL 비교연산자 !=와 <> 차이 (0) | 2023.02.20 |