programing tip

Firefox 또는 Chrome에서 수동으로 HTTP POST 요청을 실행하려면 어떻게합니까?

itbloger 2020. 9. 28. 08:24
반응형

Firefox 또는 Chrome에서 수동으로 HTTP POST 요청을 실행하려면 어떻게합니까? [닫은]


작업중인 웹 응용 프로그램에서 일부 URL을 테스트하고 싶습니다. 이를 위해 수동으로 HTTP POST 요청을 만들고 싶습니다 (원하는 매개 변수를 추가 할 수 있음).

Chrome 및 / 또는 Firefox에 누락 된 확장 프로그램이나 기능이 있습니까?


이런 종류의 작업을 위해 Postman 이라는 Chrome 앱을 만들고 있습니다. 다른 모든 확장은 약간 날짜가있는 것처럼 보였으므로 내 자신이 만들었습니다. 또한 여기에 자체 API를 문서화하는 데 도움이되는 많은 다른 기능이 있습니다.


Postman에는 이제 Windows, Mac 및 Linux 용 기본 앱 (예 : 독립형) 도 있습니다 ! 이제 네이티브 앱을 사용하는 것이 더 바람직 합니다 . 자세한 내용은 여기를 참조 하십시오 .


CURL 은 당신이 원하는 것을하기에 굉장합니다! 간단하지만 효과적인 명령 줄 도구입니다.

나머지 구현 테스트 명령 :

curl -i -X GET http://rest-api.io/items
curl -i -X GET http://rest-api.io/items/5069b47aa892630aae059584
curl -i -X DELETE http://rest-api.io/items/5069b47aa892630aae059584
curl -i -X POST -H 'Content-Type: application/json' -d '{"name": "New item", "year": "2009"}' http://rest-api.io/items
curl -i -X PUT -H 'Content-Type: application/json' -d '{"name": "Updated item", "year": "2010"}' http://rest-api.io/items/5069b47aa892630aae059584

브라우저를 잊어 버리고 CLI를 사용해보십시오. HTTPie 는 훌륭한 도구입니다!

여기에 이미지 설명 입력

CLI http 클라이언트 :

브라우저 확장을 고집하는 경우 :

크롬 :

Firefox :


Firefox

Firefox- Ctrl-Shift-Q> 개발자 도구-> 네트워크 탭 (강조 표시됨) 을 누르 거나 이동 하여 개발자 도구에서 네트워크 패널을 엽니 다 . 그런 다음 오른쪽 상단의 작은 문 아이콘 (스크린 샷의 확장 된 형태로 강조 표시된 헤더 바로 왼쪽에 있음), 두 번째 행 (보이지 않는 경우 페이지를 다시로드)-> 편집 및 원하는 요청을 다시 보내십시오.

편집 : 이미지를 추가했습니다.

"편집 및 재전송"버튼이 강조 표시된 Firefox 개발 도구

강조 표시된 POST 요청 본문


Postman for Chrome 에서 크게 영감을 얻은 저는 Firefox 용으로 비슷한 것을 작성하기로 결정했습니다.

REST Easy *는 요청에 대해 가능한 한 많은 제어를 제공하는 것을 목표로하는 재시작없는 Firefox 추가 기능입니다. 애드온은 아직 실험적 상태에 있지만 ( 아직 Mozilla에서 검토하지도 않았 음) 개발이 잘 진행되고 있습니다.

The project is open source, so if anyone feels compelled to help with development, that would be awesome: https://github.com/nathan-osman/Rest-Easy

* the add-on available from http://addons.mozilla.org will always be slightly behind the code available on GitHub


You specifically asked for "extension or functionality in Chrome and/or Firefox", which the answers you have already received provide, but I do like the simplicity of oezi's answer to the closed question "how to send a post request with a web browser" for simple parameters. oezi says:

with a form, just set method to "post"

<form action="blah.php" method="post">
  <input type="text" name="data" value="mydata" />
  <input type="submit" />
</form>

I.e. build yourself a very simple page to test the post actions.


It's a bit ugly, but there's the Simple REST Client extension for Chrome.

It works great for me -- do remember that you can still use the debugger with it. The Network pane is particularly useful; it'll give you rendered JSON objects and error pages.


For firefox there is also an extension called RESTClient which is quite nice:

https://addons.mozilla.org/en-US/firefox/addon/restclient


May not be directly related to browsers but fiddler is another good software.

Fiddler 웹 디버거


You could also use Watir or Watin to automate browsers. Watir is written for ruby and Watin is for .Net languages. Not sure if it's what you are looking for though.


Runscope를 사용해보십시오. 그들의 서비스를 샘플링하는 무료 도구는 https://www.hurl.it/ 에서 제공됩니다 . 방법, 인증, 헤더, 매개 변수 및 본문을 설정할 수 있습니다. 응답은 상태 코드, 헤더 및 본문을 보여줍니다. 응답 본문은 접을 수있는 계층 구조를 사용하여 JSON에서 형식화 할 수 있습니다. 유료 계정은 테스트 API 호출을 자동화하고 반환 데이터를 사용하여 새로운 테스트 호출을 작성할 수 있습니다. COI 공개 : 저는 Runscope와 관계가 없습니다.


체크 아웃 http-tool파이어 폭스에 대한 ..

https://addons.mozilla.org/en-US/firefox/addon/http-tool/

Aimed at web developers who need to debug HTTP requests and responses.
Can be extremely useful while developing REST based api.

Features:
* GET
* HEAD
* POST
* PUT
* DELETE

Add header(s) to request.
Add body content to request.

View header(s) in response.
View body content in response.
View status code of response.
View status text of response.

참고 URL : https://stackoverflow.com/questions/4797534/how-do-i-manually-fire-http-post-requests-with-firefox-or-chrome

반응형