Solved

Convert web request to HTTPwebRequest

Posted on 2013-01-05
3
403 Views
Last Modified: 2013-01-23
Hi,

I have a web request that I need to convert to .net the web request is currently  made via java script and is working successfully the following  is taken from chrome developers tools with the database id changed do you now how to convert it.

Request URL:https://api.tiggzi.com/rest/1/db/collections/jobs?where=%7B%22account%22%3A%22systems%22%2C+%22driver%22%3A%22JOE%22%2C+%22complete%22%3A%22false%22%7D/
Request Method:GET
Status Code:200 OK
Request Headersview source
Accept:application/json, text/javascript, */*; q=0.01
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
DNT:1
Host:api.tiggzi.com
Origin:http://project.tiggzi.com
Referer:http://project.tiggzi.com/view/7cf54281-5407-XXXXXXX-783958ec1f0e/joblist.html
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11
X-Tiggzi-Database-Id:57786655XXXXXXXX
Query String Parametersview URL encoded
where:{"account":"systems", "driver":"JOE", "complete":"false"}
Response Headersview source
Access-Control-Allow-Origin:http://project.tiggzi.com
Connection:keep-alive
Content-Type:application/json
Date:Sat, 05 Jan 2013 15:16:42 GMT
Server:nginx
Set-Cookie:JSESSIONID=gKHfYmM8UlgomPJfgpiIreIB.undefined; Path=/; Secure
Transfer-Encoding:chunked
0
Comment
Question by:JoeBo747
3 Comments
 
LVL 16

Assisted Solution

by:Easwaran Paramasivam
Easwaran Paramasivam earned 250 total points
ID: 38747258
0
 
LVL 42

Accepted Solution

by:
sedgwick earned 250 total points
ID: 38748401
since request method is GET u need to concatenate the parameters into the url string using
 '?' and '&' chars.

follow this post here:
http://stackoverflow.com/questions/3279888/how-to-add-parameters-into-a-webrequest                

make sure to pass the right request info to the suggested function and concatenate the parameters as explained.

so u ended up having the following url:

:https://api.tiggzi.com/rest/1/db/collections/jobs?account=systems&driver=JOE&complete=false

for the DB id you can add it at the end of the url in the same manner.
0
 
LVL 1

Author Closing Comment

by:JoeBo747
ID: 38811286
Sorry it has taken a while to get back to this, both your replies help in getting the correct method so only fair to share the points.
Thanks,
Joe
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question