# Testing HTTP methods on local server using Postman

**URL:** <https://forum.solidproject.org/t/testing-http-methods-on-local-server-using-postman/499>\
**Category:** Backend Development\
**Created:** [November 9, 2018, 11:02pm UTC](https://forum.solidproject.org/t/testing-http-methods-on-local-server-using-postman/499 "2018-11-09T23:02:30Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![megoth](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/megoth/32/8_2.png) [@megoth](https://forum.solidproject.org/u/megoth)\
**Post date:** [November 9, 2018, 11:02pm UTC](https://forum.solidproject.org/t/testing-http-methods-on-local-server-using-postman/499/1 "2018-11-09T23:02:30Z")

</div>

Anyone have experience testing HTTP methods (like PUT, POST, etc) on a local node-solid-server using [Postman](https://www.getpostman.com/)? I need to improve on some HTTP handling and would like to use Postman to test and explore this part, but ain’t to familiar with how to set up the authentication part of it.

I have set up a simple local instance of NSS with self-signed certificates (running `lib/solid-test` when I need to test the server), and have created some WebIDs (and PODs) using OIDC. I’m unable to find a method for authorization method for it on [Postman’s documentation on Authorization](https://www.getpostman.com/docs/v6/postman/sending_api_requests/authorization), so I reckon it’s not supported…

Any help is appreciated 🙂

---

<div class="post-metadata">

**Author:** ![megoth](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/megoth/32/8_2.png) [@megoth](https://forum.solidproject.org/u/megoth)\
**Post date:** [November 9, 2018, 11:03pm UTC](https://forum.solidproject.org/t/testing-http-methods-on-local-server-using-postman/499/2 "2018-11-09T23:03:48Z")

</div>

If I’m unable to handle it with Postman, I’ll probably just bootstrap a simple Solid app that handles it for me (using [solid-auth-client](https://github.com/solid/solid-auth-client) or maybe a simple [Fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)), but wanted to explore the possibility of using Postman first.

---

<div class="post-metadata">

**Author:** ![happybeing](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/happybeing/32/59_2.png) [@happybeing](https://forum.solidproject.org/u/happybeing)\
**Post date:** [November 10, 2018, 11:27am UTC](https://forum.solidproject.org/t/testing-http-methods-on-local-server-using-postman/499/3 "2018-11-10T11:27:02Z")

</div>

I haven’t done much of this, but when I was debugging my LDP emulation I used a plugin within Atom editor and it worked a treat.

---

<div class="post-metadata">

**Author:** ![codenamedmitri](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/codenamedmitri/32/169_2.png) [@codenamedmitri](https://forum.solidproject.org/u/codenamedmitri)\
**Post date:** [November 10, 2018, 8:08pm UTC](https://forum.solidproject.org/t/testing-http-methods-on-local-server-using-postman/499/4 "2018-11-10T20:08:11Z")

</div>

Ok, so, I’ve played around with Postman, and here’s what I recommend for the moment:

#### Option 1 - Use a cookie

Easiest way to do it - open up Developer Tools / Web Console (the thing that has the Network tab) in your browser. Log in to whichever Solid server you’re testing, enter in your username & password, etc.

In the Network tab, find a POST to /login/password, look for the `set-cookie: connect.sid=s%3ApEnyYz3UWh..; Domain=whatever; Path=...` header in the Response.

Now you can include that cookie with all your Postman requests. So, in Postman, switch to the Headers tab, and add `Cookie` header, with value `connect.sid=s%3ApEnyYz3UWh..` (obviously substitute your own cookie value).

#### Option 2 - Use solid-auth-client

Though you can do the whole “register an app, then do a 3-legged OAuth2 flow” process in Postman, it’s way simpler to let solid-auth-client do it for you.

* * *

All that said, we should put on the roadmap to make a dev-friendly UI (kind of like Facebook’s Graph Explorer) that will let people register their sample apps, get tokens, etc.

---

<div class="post-metadata">

**Author:** ![megoth](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/megoth/32/8_2.png) [@megoth](https://forum.solidproject.org/u/megoth)\
**Post date:** [December 2, 2018, 6:45pm UTC](https://forum.solidproject.org/t/testing-http-methods-on-local-server-using-postman/499/5 "2018-12-02T18:45:04Z")

</div>

@codenamedmitri I’m able to make HTTP request using Postman on a Solid server that has proper certificates using the approaches you mentioned, but on my local machine where I have self-signed certificates I’m failing. So just to double-check, were you successful with these methods on a local setup with self-signed certificates?

---

<div class="post-metadata">

**Author:** ![codenamedmitri](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/codenamedmitri/32/169_2.png) [@codenamedmitri](https://forum.solidproject.org/u/codenamedmitri)\
**Post date:** [December 5, 2018, 8:29pm UTC](https://forum.solidproject.org/t/testing-http-methods-on-local-server-using-postman/499/6 "2018-12-05T20:29:11Z")

</div>

@megoth - I think I had to load up the local pod URL first, click through the usual ‘accept invalid certificate’ prompt, and then use Postman.

But yeah, certs are a perennial problem.

---

<div class="post-metadata">

**Author:** ![rimmartin](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/rimmartin/32/166_2.png) [@rimmartin](https://forum.solidproject.org/u/rimmartin)\
**Post date:** [December 5, 2018, 8:59pm UTC](https://forum.solidproject.org/t/testing-http-methods-on-local-server-using-postman/499/7 "2018-12-05T20:59:51Z")

</div>

How to identify the user and password fields so the test framework can automate getting past this and sequentially get to the testing on an apps page?

---

<div class="post-metadata">

**Author:** ![megoth](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/megoth/32/8_2.png) [@megoth](https://forum.solidproject.org/u/megoth)\
**Post date:** [December 5, 2018, 10:50pm UTC](https://forum.solidproject.org/t/testing-http-methods-on-local-server-using-postman/499/8 "2018-12-05T22:50:10Z")

</div>

Yeah, I tried that (accept invalid certificate), but still didn’t work =/

I’ll give it another go another day 🙂
