Translate curl command to NSURLRequest

2015-07-04 Thread Antonio Nunes
I have the following curl command to a web api, which retrieves some info: curl -X GET -H 'Authorization: Basic blabla' -H 'Content-Type: application/xml; charset=utf-8' -H 'Accept-Language: en' -d "y...@example.comSomePassWord" 'https://example.com/api/v1/endpoint The -d and xml-string are man

Re: Translate curl command to NSURLRequest

2015-07-04 Thread Jerry Krinock
> On 2015 Jul 04, at 02:52, Antonio Nunes wrote: > > Is there a way to see exactly what the request looks like when it goes out? Search for “OS X Packet Sniffer” and you will find many apps for this, and even some stuff built into OS X, which are quite fun to use. My favorite (because it can

Re: Translate curl command to NSURLRequest

2015-07-04 Thread Rick Mann
FWIW, you're setting the Accept header, not Content-Type (nor Accept-Language). > On Jul 4, 2015, at 02:52 , Antonio Nunes wrote: > > I have the following curl command to a web api, which retrieves some info: > curl -X GET -H 'Authorization: Basic blabla' -H 'Content-Type: > application/xml; ch

NSNumberFormatter Issues

2015-07-04 Thread Gordon Apple
I¹m having a new problem, in code that¹s been around for awhile, that I¹d swear was never there before. Text field had a NSNumberFormatter and is bound to a CGFloat. It is for angle entry and the format is set to show the degree symbol suffix. A Circular slider is bound to the same value. Text disp

Re: Translate curl command to NSURLRequest

2015-07-04 Thread Jens Alfke
> On Jul 4, 2015, at 11:04 AM, Rick Mann wrote: > > FWIW, you're setting the Accept header, not Content-Type (nor > Accept-Language). Yup. And I’m pretty sure you [the OP] don’t want to add that Accept header to all requests, since it’s telling the server to give up (with a 406 status) if th

Re: Translate curl command to NSURLRequest

2015-07-04 Thread Michael David Crawford
Would it work to use libcurl instead? I dont know but would be unsurprised were that to be what NSURLRequest actually does. -- Michael David Crawford, Consulting Software Engineer mdcrawf...@gmail.com http://www.warplife.com/mdc/ Available for Software Development in the Portland, Oregon Me

Re: Translate curl command to NSURLRequest

2015-07-04 Thread Antonio Nunes
Thanks for the pointer to macnetworkprog Jerry, and for the link to Charles. I should probably have mentioned in my post that this is an iOS app, not a Mac app. Would that matter for macnetworkprog, or is the list appropriate for iOS too? António > On 04 Jul 2015, at 13:59, Jerry Krinock wrot

Re: Translate curl command to NSURLRequest

2015-07-04 Thread Antonio Nunes
Ugh, I’ve corrected the headers. But it doesn’t make a difference regarding the result. -António > On 04 Jul 2015, at 19:04, Rick Mann wrote: > > FWIW, you're setting the Accept header, not Content-Type (nor > Accept-Language). > >> On Jul 4, 2015, at 02:52 , Antonio Nunes wrote: >> >> I h

Re: Translate curl command to NSURLRequest

2015-07-04 Thread Antonio Nunes
> On 05 Jul 2015, at 00:45, Michael David Crawford wrote: > > Would it work to use libcurl instead? > > I dont know but would be unsurprised were that to be what NSURLRequest > actually does. Probably, but this is on iOS, so I would have to package a libcurl build into the app, adding a few MB

Re: Translate curl command to NSURLRequest

2015-07-04 Thread Antonio Nunes
On 04 Jul 2015, at 22:03, Jens Alfke wrote: > > (Sending a GET request with a body is pretty unusual, but I assume that’s > what the server wants since you say the curl command works…) Yes, I’m not happy about this, and I think this is also what is causing the issue, since it looks like the bo

Re: NSNumberFormatter Issues

2015-07-04 Thread Graham Cox
> On 5 Jul 2015, at 6:53 am, Gordon Apple wrote: > > However, if user changes the > displayed value, leaving the degree symbol intact, it says it is invalid and > throws an exception, essentially ending the program run. This is totally > unacceptable. What is going on here? (And this behavior is