본문 바로가기

hacking or software engineering skills/etc

[postman] postman 이용해서 post 쿼리 날려보기. 에러 the request Content-Type was not 'application/json'.

반응형

post 방식으로 포스트맨 이용해서 flask 웹서버에 쿼리를 날리고 있었다.

그런데 자꾸 이런 에러가 뜨는 상황

문제점

문제는 내가 postman이란 프로그램을 처음 사용해봐서 생기는 것 같았다.

Did not attempt to load JSON data because the request Content-Type was not 'application/json'.

the request Content-Type was not 'application/json'.로 보아 날려주는 내용이 json 형태가 아님을 확인

해결책

postman 관련 검색을 통해 해결할 수 있었다.



이런식으로 POST 방식을 선택하고, Body를 누른뒤 raw부분으로 json 데이터 형식으로 데이터를 전송해주면 된다. 간단하다!

https://learning.postman.com/docs/sending-requests/requests/

 

Building requests | Postman Learning Center

Building requests: documentation for Postman, the collaboration platform for API development. Create better APIs—faster.

learning.postman.com

반응형