# HTTP Request - Matching functionality to Win 10 cURL request

**URL:** https://discourse.nodered.org/t/http-request-matching-functionality-to-win-10-curl-request/59264
**Category:** General
**Created:** [3 March 2022 04:51 UTC](https://discourse.nodered.org/t/http-request-matching-functionality-to-win-10-curl-request/59264 "2022-03-03T04:51:08Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![jkw\_ee](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@jkw\_ee](https://discourse.nodered.org/u/jkw_ee)
#### Post date: [3 March 2022 04:51 UTC](https://discourse.nodered.org/t/http-request-matching-functionality-to-win-10-curl-request/59264/1 "2022-03-03T04:51:09Z")

</div>

Hi -

Very new to this word, working through a examples and building up some functionality as I learn so thank you in advance.

I am pulling a list of cameras from a video server as a "building block". I started verifying that I could reach the server and make the API call using cURL (Win 10) first. This was successful and passes credentials with the request and uses the -k option to ignore the local self signed cert. The credentials are in the screen shot below, but are only for a local test server so no risk or danger.

C:\Windows\system32\>curl [https://192.168.2.250/api/cameras](https://192.168.2.250/api/cameras) -k -u cold:beer

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/c/8c21144fa3ead9849e359c6ece2100cca43f2f18.png)

Now moving into Node-RED, I am attempting to emulate this functionally using using an HTTP Request node.

- I have placed a change node in front of the HTTP request node with set the rejectUnauthorized to False to ignore the SSL rejection. (-k option cURL)
- I have set the url in the HTTP Request to [https://192.168.2.250/api/cameras](https://192.168.2.250/api/cameras) matching that of the cURL request
- I have entered the credentials and selected basic authentication

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/5/f554902e9725c679d4973621500c3a9b5aa3b179.png)

It does not return the data instead I receive this `msg.payload : string[3024] "{"message":"Unable to locate view \u0027ListResponseDto`1\u0027\r\nCurrently available view engine extensions: sshtml,html,htm,cshtml,vbhtml\r\nLocations inspected: views/api/cameras/Cameras/ListResponseDto`1-en-US,views/api/cameras/Cameras/ListResponseDto`1,api/cameras/Cameras/ListResponseDto`1-en-US,api/cameras/Cameras/ListResponseDto`1,views/api/cameras/ListResponseDto`1-en-US,views/api/cameras/ListResponseDto`1,api/cameras/ListResponseDto`1-en-US,api/cameras/ListResponseDto`1,views/Cameras/ListResponseDto`1-en-US,views/Cameras/ListResponseDto`1,Cameras/ListResponseDto`1-en-US,Cameras/ListResponseDto`1,views/ListResponseDto`1-en-US,views/ListResponseDto`1,ListResponseDto`1-en-US,ListResponseDto`1\r\nRoot path: C:\Program Files\Senstar\Symphony Server v7\_bin\\r\nIf you were expecting raw data back, make sure you set the \u0027Accept\u0027-header of the request to correct format, for example \u0027application/json\u0027","exception":"Nancy.ViewEngines.ViewNotFoundException: Unab..."`

I have tried alternate authentication settings, I have tried adding a content type in the change note to indcate the json output, I have also changed the return formatting and nothing seem to make a difference.

Looking for a crumb to follow, have searched till my searcher is sore.

Thanks

---

<div class="post-metadata">

### Author: ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)
#### Post date: [3 March 2022 06:14 UTC](https://discourse.nodered.org/t/http-request-matching-functionality-to-win-10-curl-request/59264/2 "2022-03-03T06:14:01Z")

</div>

> [@jkw\_ee](#):
>
> make sure you set the \u0027Accept\u0027-header of the request to correct format, for example \u0027application/json\

Try before your http-request node to set the headers for json (not for Content-type but for Accept)  
In a preceding Function node add :

```auto
msg.headers = { "Accept" : "application/json"}
return msg;

```

---

<div class="post-metadata">

### Author: ![jkw\_ee](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@jkw\_ee](https://discourse.nodered.org/u/jkw_ee)
#### Post date: [3 March 2022 12:08 UTC](https://discourse.nodered.org/t/http-request-matching-functionality-to-win-10-curl-request/59264/3 "2022-03-03T12:08:28Z")

</div>

UnborN - you are a lifesaver, I could not see the forest for the trees on that one. All works now.

Thanks

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [17 March 2022 12:09 UTC](https://discourse.nodered.org/t/http-request-matching-functionality-to-win-10-curl-request/59264/4 "2022-03-17T12:09:21Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
