Jump to content
View in the app

A better way to browse. Learn more.

Universal Devices Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Second Post Request

Featured Replies

Posted

Hi

I have the following in the Resource Editor

that is set for 'post' and 'raw text':

 

POST /ethAccount.asmx/SignIn HTTP/1.1

Host: urlname

Content-Type: application/json; charset=utf-8

Content-Language: json

Connection: keep-alive

User-Agent: Mozilla/4.0

{ "email" : "myemail", "password" : "mypass" }

 

POST /ethClient.asmx/Ping HTTP/1.1

{ "id" : "0" }

 

I think the first part works as I get a return of HTTP 1.1 2 without the second post attached.

What I would like to do is attach the second request to the first in order to use the

same logged in session. I know it is a lot more complex then just adding a post. One time the

editor came back with a string starting with 'Request ..... but I failed to wright it down.

The data{} is what is required in the APIs

So, I guess the question is whether or not this is possible?

 

Thanks much for any assistance.

Gary

l

Hi Gary,

 

I do not think the first part is POST since you don't have a content-length = the length of the body.

 

Also, if you want to do pipelining, what you need to do is to add ALL the headers for the second post inside the body of the first post. This should include content-length. Furthermore, you will have to use C-Escaped since, for the second post, the header must be separated from the body by \r\n\r\n.

 

With kind regards,

Michel

  • Author

Thanks l very much Michel for your reply.

I didn't put the length in because the ISY always seems to figure that out and enter it into the content length. I'm not sure how to figure that out. Do you just count the characters in the body?

Also I would be greatly thankful if you could show a sample of what the parameters might look like. Been at this in different ways now for about two weeks including trying to use Python in EventGhost.

 

Thanks.

Gary

Hi Gary,

 

I'm not sure how to figure that out. Do you just count the characters in the body?

Yes.

 

Also I would be greatly thankful if you could show a sample of what the parameters might look like. Been at this in different ways now for about two weeks including trying to use Python in EventGhost.

 

Please try this:

Make sure you use POST and C-Escaped. Connection-Close should be keep-alive.

 

---> for the first one, simply let ISY create the package for you. The body would be
{ "email" : "myemail", "password" : "mypass" }
---> Then, in the body, add the following:

POST /ethClient.asmx/Ping HTTP/1.1\r\n
Host: urlname\r\n
Content-Type: application/json; charset=utf-8\r\n
Content-Language: json\r\n
Connection: keep-alive\r\n
User-Agent: Mozilla/4.0\r\n
Content-Length: 28\r\n\r\n
{ "id" : "0" }
{ "id" : "0" }

 

With kind regards,

Michel

Guest
This topic is now closed to further replies.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.